本文整理汇总了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
示例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
示例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
示例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
示例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
示例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