augmentation.py 文件源码

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

项目:gconv_experiments 作者: tscohen 项目源码 文件源码
def translate_transform_batch(x):

    t = (np.random.rand(x.shape[0], 2) - 0.5) * 4

    x_out = np.empty_like(x)
    for i in range(x.shape[0]):

        # Super slow but whatever...
        shift(x[i, 0], shift=t[i], output=x_out[i, 0], order=3, mode='reflect')
        shift(x[i, 1], shift=t[i], output=x_out[i, 1], order=3, mode='reflect')
        shift(x[i, 2], shift=t[i], output=x_out[i, 2], order=3, mode='reflect')

    return x_out
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号