切片(crop):
def crop(image, random_crop, image_size):
if image.shape[1]>image_size:
sz1 = int...and np.random.choice([True, False]):
image = np.flipud(image)
return image
#图像旋转
def random_rotate_image...w,h = image.shape[1], image.shape[0]
# 0-180随机产生旋转角度。...]/2, image.shape[0]/2), angle=angle, scale=0.7)
# image = cv2.warpAffine(image, RotateMatrix,...([True, False]):
image = exposure.adjust_gamma(image, 0.7) # 调暗
return image