Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import os
|
3 |
import cv2
|
4 |
import argparse
|
@@ -117,11 +116,9 @@ def load_img (filename, norm=True):
|
|
117 |
|
118 |
def inference(image, upscale, large_input_flag, color_fix):
|
119 |
model = set_safmn(upscale)
|
120 |
-
|
121 |
-
img = np.array(image)
|
122 |
-
img = img.astype(np.float32) / 255.
|
123 |
|
124 |
-
# img2tensor
|
125 |
y = torch.from_numpy(np.transpose(img[:, :, [2, 1, 0]], (2, 0, 1))).float()
|
126 |
y = y.unsqueeze(0).to(device)
|
127 |
|
@@ -173,11 +170,8 @@ title = "SAFMN for Real-world SR"
|
|
173 |
description = ''' ### Spatially-Adaptive Feature Modulation for Efficient Image Super-Resolution - ICCV 2023
|
174 |
#### Long Sun](https://github.com/sunny2109), [Jiangxin Dong](https://scholar.google.com/citations?user=ruebFVEAAAAJ&hl=zh-CN&oi=ao), [Jinhui Tang](https://scholar.google.com/citations?user=ByBLlEwAAAAJ&hl=zh-CN), and [Jinshan Pan](https://jspan.github.io/)
|
175 |
#### [IMAG Lab](https://imag-njust.net/), Nanjing University of Science and Technology
|
176 |
-
|
177 |
-
|
178 |
#### Drag the slider on the super-resolution image left and right to see the changes in the image details. SAFMN performs x2/x4 upscaling on the input image.
|
179 |
<br>
|
180 |
-
|
181 |
### If our work is useful for your research, please consider citing:
|
182 |
<code>
|
183 |
@inproceedings{sun2023safmn,
|
|
|
|
|
1 |
import os
|
2 |
import cv2
|
3 |
import argparse
|
|
|
116 |
|
117 |
def inference(image, upscale, large_input_flag, color_fix):
|
118 |
model = set_safmn(upscale)
|
119 |
+
|
120 |
+
img = np.array(image).astype(np.float32) / 255.
|
|
|
121 |
|
|
|
122 |
y = torch.from_numpy(np.transpose(img[:, :, [2, 1, 0]], (2, 0, 1))).float()
|
123 |
y = y.unsqueeze(0).to(device)
|
124 |
|
|
|
170 |
description = ''' ### Spatially-Adaptive Feature Modulation for Efficient Image Super-Resolution - ICCV 2023
|
171 |
#### Long Sun](https://github.com/sunny2109), [Jiangxin Dong](https://scholar.google.com/citations?user=ruebFVEAAAAJ&hl=zh-CN&oi=ao), [Jinhui Tang](https://scholar.google.com/citations?user=ByBLlEwAAAAJ&hl=zh-CN), and [Jinshan Pan](https://jspan.github.io/)
|
172 |
#### [IMAG Lab](https://imag-njust.net/), Nanjing University of Science and Technology
|
|
|
|
|
173 |
#### Drag the slider on the super-resolution image left and right to see the changes in the image details. SAFMN performs x2/x4 upscaling on the input image.
|
174 |
<br>
|
|
|
175 |
### If our work is useful for your research, please consider citing:
|
176 |
<code>
|
177 |
@inproceedings{sun2023safmn,
|