当前位置: 首页>>代码示例>>Python>>正文


Python common.augment方法代码示例

本文整理汇总了Python中data.common.augment方法的典型用法代码示例。如果您正苦于以下问题:Python common.augment方法的具体用法?Python common.augment怎么用?Python common.augment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data.common的用法示例。


在下文中一共展示了common.augment方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def get_patch(self, lr, hr):
        scale = self.scale[self.idx_scale]
        if self.train:
            lr, hr = common.get_patch(
                lr, hr,
                patch_size=self.args.patch_size,
                scale=scale,
                multi=(len(self.scale) > 1),
                input_large=self.input_large
            )
            if not self.args.no_augment: lr, hr = common.augment(lr, hr)
        else:
            ih, iw = lr.shape[:2]
            hr = hr[0:ih * scale, 0:iw * scale]

        return lr, hr 
开发者ID:HolmesShuan,项目名称:OISR-PyTorch,代码行数:18,代码来源:srdata.py

示例2: _get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def _get_patch(self, lr, hr):
        patch_size = self.args.patch_size
        scale = self.scale[self.idx_scale]
        multi_scale = len(self.scale) > 1
        if self.train:
            #from IPython import embed; embed(); exit()
            lr, hr = common.get_patch(
                lr, hr, patch_size, scale, multi_scale=multi_scale
            )
            lr, hr = common.augment([lr, hr])
            lr = common.add_noise(lr, self.args.noise)
        else:
            ih, iw = lr.shape[0:2]
            hr = hr[0:ih * scale, 0:iw * scale]

        return lr, hr 
开发者ID:ofsoundof,项目名称:3D_Appearance_SR,代码行数:18,代码来源:srdata.py

示例3: _get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def _get_patch(self, lr, nl, mk, hr):
        patch_size = self.args.patch_size
        scale = self.scale[self.idx_scale]
        multi_scale = len(self.scale) > 1
        if self.train:
            #from IPython import embed; embed(); exit()
            lr, nl, mk, hr = self.get_patch(
                lr, nl, mk, hr, patch_size, scale, multi_scale=multi_scale
            )
            lr, nl, mk, hr = common.augment([lr, nl, mk, hr])
            lr = common.add_noise(lr, self.args.noise)
        else:
            ih, iw = lr.shape[0:2]
            hr = hr[0:ih * scale, 0:iw * scale]
            if not self.normal_lr:
                nl = nl[0:ih * scale, 0:iw * scale]

        return lr, nl, mk, hr 
开发者ID:ofsoundof,项目名称:3D_Appearance_SR,代码行数:20,代码来源:srtexture.py

示例4: get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def get_patch(self, lr, hr):
        scale = self.scale[self.idx_scale]
        multi_scale = len(self.scale) > 1
        if self.train:
            lr, hr = common.get_patch(
                lr,
                hr,
                patch_size=self.args.patch_size,
                scale=scale,
                multi_scale=multi_scale
            )
            if not self.args.no_augment:
                lr, hr = common.augment(lr, hr)
        else:
            ih, iw = lr.shape[:2]
            hr = hr[0:ih * scale, 0:iw * scale]

        return lr, hr 
开发者ID:ChaofWang,项目名称:AWSRN,代码行数:20,代码来源:srdata.py

示例5: _get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def _get_patch(self, lr, hr):

        LR_size = self.opt['LR_size']
        # random crop and augment
        lr, hr = common.get_patch(
            lr, hr, LR_size, self.scale)
        lr, hr = common.augment([lr, hr])
        lr = common.add_noise(lr, self.opt['noise'])

        return lr, hr 
开发者ID:Paper99,项目名称:SRFBN_CVPR19,代码行数:12,代码来源:LRHR_dataset.py

示例6: _get_patch

# 需要导入模块: from data import common [as 别名]
# 或者: from data.common import augment [as 别名]
def _get_patch(self, lr, hr):
        patch_size = self.args.patch_size
        scale = self.scale[self.idx_scale]
        multi_scale = len(self.scale) > 1
        if self.train:
            lr, hr = common.get_patch(
                lr, hr, patch_size, scale, multi_scale=multi_scale
            )
            lr, hr = common.augment([lr, hr])
            lr = common.add_noise(lr, self.args.noise)
        else:
            ih, iw = lr.shape[0:2]
            hr = hr[0:ih * scale, 0:iw * scale]

        return lr, hr 
开发者ID:MIVRC,项目名称:MSRN-PyTorch,代码行数:17,代码来源:srdata.py


注:本文中的data.common.augment方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。