data.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:tefla 作者: litan 项目源码 文件源码
def build_augmentation_transform(zoom=(1.0, 1.0), rotation=0, shear=0, translation=(0, 0), flip=False):
    if flip:
        shear += 180
        rotation += 180
        # shear by 180 degrees is equivalent to rotation by 180 degrees + flip.
        # So after that we rotate it another 180 degrees to get just the flip.

    tform_augment = skimage.transform.AffineTransform(scale=(1 / zoom[0], 1 / zoom[1]), rotation=np.deg2rad(rotation),
                                                      shear=np.deg2rad(shear), translation=translation)
    return tform_augment


# internal stuff below
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号