Skip to content

Commit 1604933

Browse files
committed
Upgrade
1 parent 6fcc739 commit 1604933

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

figure/sr_comic.png

1.66 KB
Loading

inference.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ def main(args):
6565
lr_y_tensor, lr_cb_image, lr_cr_image = imgproc.preprocess_one_image(args.inputs_path, device)
6666

6767
bic_cb_image = cv2.resize(lr_cb_image,
68-
(int(lr_cb_image.shape[0] * args.upscale_factor),
69-
int(lr_cb_image.shape[1] * args.upscale_factor)),
68+
(int(lr_cb_image.shape[1] * args.upscale_factor),
69+
int(lr_cb_image.shape[0] * args.upscale_factor)),
7070
interpolation=cv2.INTER_CUBIC)
7171
bic_cr_image = cv2.resize(lr_cr_image,
72-
(int(lr_cr_image.shape[0] * args.upscale_factor),
73-
int(lr_cr_image.shape[1] * args.upscale_factor)),
72+
(int(lr_cr_image.shape[1] * args.upscale_factor),
73+
int(lr_cr_image.shape[0] * args.upscale_factor)),
7474
interpolation=cv2.INTER_CUBIC)
7575
# Use the model to generate super-resolved images
7676
with torch.no_grad():
@@ -80,7 +80,7 @@ def main(args):
8080
sr_y_image = imgproc.tensor_to_image(sr_y_tensor, range_norm=False, half=False)
8181
sr_y_image = sr_y_image.astype(np.float32) / 255.0
8282

83-
sr_ycbcr_image = cv2.merge([np.transpose(sr_y_image[:, :, 0], (1, 0)), bic_cb_image, bic_cr_image])
83+
sr_ycbcr_image = cv2.merge([sr_y_image[:, :, 0], bic_cb_image, bic_cr_image])
8484
sr_image = imgproc.ycbcr_to_bgr(sr_ycbcr_image)
8585
cv2.imwrite(args.output_path, sr_image * 255.0)
8686

0 commit comments

Comments
 (0)