transforms.py 文件源码

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

项目:KagglePlanetPytorch 作者: Mctigger 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号