add Real-ESRGAN training codes

This commit is contained in:
Xintao
2021-07-24 18:56:20 +08:00
parent 85bd346714
commit 9baeba566b
10 changed files with 999 additions and 4 deletions

View File

@@ -17,9 +17,7 @@ def main():
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# set up model
# FIXME: currenly RRDBNet in BasicSR does not support scale argument. Will update later
# model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=args.scale)
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32)
model = RRDBNet(num_in_ch=3, num_out_ch=3, num_feat=64, num_block=23, num_grow_ch=32, scale=args.scale)
loadnet = torch.load(args.model_path)
model.load_state_dict(loadnet['params_ema'], strict=True)
model.eval()