dataset.py 文件源码

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

项目:superres 作者: ntomita 项目源码 文件源码
def transform_input(crop_size, upscale_factor):
    """LR of target image
    """
    return Compose([
        Scale(crop_size // upscale_factor),
        ])


# def transform_target_batch(crop_size):
#     def transform(image):
#         patches = extract_subimages(image, crop_size, crop_size)
#         patches = [ToTensor()(x) for x in patches]
#         return stack(patches, 0)
#     return transform


# def transform_input_batch(crop_size, upscale_factor):
#     def transform(image):
#         patches = extract_subimages(image, crop_size, crop_size)
#         patches = [Compose([Scale(crop_size//upscale_factor), ToTensor()])(x) for x in patches]
#         return stack(patches, 0)
#     return transform
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号