Spaces:
Running
Running
Hu
commited on
Commit
·
903a2ee
1
Parent(s):
2d5af56
change transforms.Resize interplation mode
Browse files
app.py
CHANGED
|
@@ -64,15 +64,15 @@ def pred_SRCNN(model, image, device, scale_factor=2):
|
|
| 64 |
# bicubic interpolate it to the original size
|
| 65 |
y_bicubic = transforms.Resize(
|
| 66 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 67 |
-
interpolation=
|
| 68 |
)(y)
|
| 69 |
cb_bicubic = transforms.Resize(
|
| 70 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 71 |
-
interpolation=
|
| 72 |
)(cb)
|
| 73 |
cr_bicubic = transforms.Resize(
|
| 74 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 75 |
-
interpolation=
|
| 76 |
)(cr)
|
| 77 |
# turn it into tensor and add batch dimension
|
| 78 |
y_bicubic = transforms.ToTensor()(y_bicubic).to(device).unsqueeze(0)
|
|
@@ -93,7 +93,7 @@ def pred_SRCNN(model, image, device, scale_factor=2):
|
|
| 93 |
|
| 94 |
image_bicubic = transforms.Resize(
|
| 95 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 96 |
-
interpolation=
|
| 97 |
)(image)
|
| 98 |
return out_final, image_bicubic, image
|
| 99 |
|
|
|
|
| 64 |
# bicubic interpolate it to the original size
|
| 65 |
y_bicubic = transforms.Resize(
|
| 66 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 67 |
+
interpolation=InterpolationMode.BICUBIC,
|
| 68 |
)(y)
|
| 69 |
cb_bicubic = transforms.Resize(
|
| 70 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 71 |
+
interpolation=InterpolationMode.BICUBIC,
|
| 72 |
)(cb)
|
| 73 |
cr_bicubic = transforms.Resize(
|
| 74 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 75 |
+
interpolation=InterpolationMode.BICUBIC,
|
| 76 |
)(cr)
|
| 77 |
# turn it into tensor and add batch dimension
|
| 78 |
y_bicubic = transforms.ToTensor()(y_bicubic).to(device).unsqueeze(0)
|
|
|
|
| 93 |
|
| 94 |
image_bicubic = transforms.Resize(
|
| 95 |
(original_size[1] * scale_factor, original_size[0] * scale_factor),
|
| 96 |
+
interpolation=InterpolationMode.BICUBIC,
|
| 97 |
)(image)
|
| 98 |
return out_final, image_bicubic, image
|
| 99 |
|