Update app.py
Browse files
app.py
CHANGED
|
@@ -152,11 +152,11 @@ def inference(image, upscale, large_input_flag, color_fix):
|
|
| 152 |
output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
|
| 153 |
output = (output * 255.0).round().astype(np.uint8)
|
| 154 |
|
| 155 |
-
#
|
| 156 |
-
|
| 157 |
-
|
| 158 |
|
| 159 |
-
return (image, Image.fromarray(output)),
|
| 160 |
|
| 161 |
|
| 162 |
|
|
@@ -239,13 +239,13 @@ demo = gr.Interface(
|
|
| 239 |
type="pil",
|
| 240 |
show_download_button=True,
|
| 241 |
),
|
| 242 |
-
# gr.Image(
|
| 243 |
-
# label="Download Output",
|
| 244 |
-
# type='filepath'
|
| 245 |
-
# ),
|
| 246 |
gr.Image(
|
| 247 |
-
label="Download Output"
|
|
|
|
| 248 |
),
|
|
|
|
|
|
|
|
|
|
| 249 |
],
|
| 250 |
title=title,
|
| 251 |
description=description,
|
|
|
|
| 152 |
output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
|
| 153 |
output = (output * 255.0).round().astype(np.uint8)
|
| 154 |
|
| 155 |
+
# save results
|
| 156 |
+
save_path = './out.png'
|
| 157 |
+
cv2.imwrite(save_path, output)
|
| 158 |
|
| 159 |
+
return (image, Image.fromarray(output)), save_path
|
| 160 |
|
| 161 |
|
| 162 |
|
|
|
|
| 239 |
type="pil",
|
| 240 |
show_download_button=True,
|
| 241 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
gr.Image(
|
| 243 |
+
label="Download Output",
|
| 244 |
+
type='filepath',
|
| 245 |
),
|
| 246 |
+
# gr.Image(
|
| 247 |
+
# label="Download Output"
|
| 248 |
+
# ),
|
| 249 |
],
|
| 250 |
title=title,
|
| 251 |
description=description,
|