|
|
@ -17,6 +17,7 @@ class ImageDemoOptions():
|
|
|
|
self.parser.add_argument('--lr_image_path', '-b', type=str, default="../data/Set14/LR/X4/monarch.png", help="LR image path")
|
|
|
|
self.parser.add_argument('--lr_image_path', '-b', type=str, default="../data/Set14/LR/X4/monarch.png", help="LR image path")
|
|
|
|
self.parser.add_argument('--project_path', type=str, default="../", help="Project path.")
|
|
|
|
self.parser.add_argument('--project_path', type=str, default="../", help="Project path.")
|
|
|
|
self.parser.add_argument('--batch_size', type=int, default=2**10, help="Size of the batch for the input domain values.")
|
|
|
|
self.parser.add_argument('--batch_size', type=int, default=2**10, help="Size of the batch for the input domain values.")
|
|
|
|
|
|
|
|
self.parser.add_argument('--mirror', action='store_true', default=False)
|
|
|
|
|
|
|
|
|
|
|
|
def parse_args(self):
|
|
|
|
def parse_args(self):
|
|
|
|
args = self.parser.parse_args()
|
|
|
|
args = self.parser.parse_args()
|
|
|
@ -51,8 +52,13 @@ lut_model = LoadCheckpoint(config.lut_model_path).cuda()
|
|
|
|
print(net_model)
|
|
|
|
print(net_model)
|
|
|
|
print(lut_model)
|
|
|
|
print(lut_model)
|
|
|
|
|
|
|
|
|
|
|
|
lr_image = cv2.imread(str(config.lr_image_path))[:,:,::-1].copy()
|
|
|
|
lr_image = cv2.imread(str(config.lr_image_path))[:,:,::-1]
|
|
|
|
image_gt = cv2.imread(str(config.hr_image_path))[:,:,::-1].copy()
|
|
|
|
image_gt = cv2.imread(str(config.hr_image_path))[:,:,::-1]
|
|
|
|
|
|
|
|
if config.mirror:
|
|
|
|
|
|
|
|
lr_image = lr_image[:,::-1,:]
|
|
|
|
|
|
|
|
image_gt = image_gt[:,::-1,:]
|
|
|
|
|
|
|
|
lr_image = lr_image.copy()
|
|
|
|
|
|
|
|
image_gt = image_gt.copy()
|
|
|
|
|
|
|
|
|
|
|
|
input_image = torch.tensor(lr_image).type(torch.float32).permute(2,0,1)[None,...].cuda()
|
|
|
|
input_image = torch.tensor(lr_image).type(torch.float32).permute(2,0,1)[None,...].cuda()
|
|
|
|
|
|
|
|
|
|
|
|