def augment_deterministic(
rotation=0,
translation=0,
scale_factor=1,
shear=0
):
def call(x):
scale = scale_factor, scale_factor
rotation_tmp = rotation
tf_augment = AffineTransform(
scale=scale,
rotation=np.deg2rad(rotation_tmp),
translation=translation,
shear=np.deg2rad(shear)
)
tf = tf_center + tf_augment + tf_uncenter
x = warp(x, tf, order=1, preserve_range=True, mode='symmetric')
return x
return call
评论列表
文章目录