Spaces:
Running
Running
Hu
commited on
Commit
·
ef80f7e
1
Parent(s):
ebadb7a
change input
Browse files
app.py
CHANGED
|
@@ -125,7 +125,7 @@ model.eval()
|
|
| 125 |
# return grid
|
| 126 |
|
| 127 |
|
| 128 |
-
def super_reso(
|
| 129 |
# gradio open image as np array
|
| 130 |
#image_array = np.asarray(image_path)
|
| 131 |
#image = Image.fromarray(image_array, mode="RGB")
|
|
@@ -133,7 +133,7 @@ def super_reso(image):
|
|
| 133 |
# prediction
|
| 134 |
with torch.no_grad():
|
| 135 |
out_final, image_bicubic = pred_SRCNN(
|
| 136 |
-
model=model, image=
|
| 137 |
)
|
| 138 |
# grid = image_grid([out_final,image_bicubic],1,2)
|
| 139 |
return out_final, image_bicubic
|
|
@@ -150,4 +150,4 @@ gr.Interface(
|
|
| 150 |
description=description,
|
| 151 |
article=article,
|
| 152 |
examples=examples,
|
| 153 |
-
).launch(
|
|
|
|
| 125 |
# return grid
|
| 126 |
|
| 127 |
|
| 128 |
+
def super_reso(input_image):
|
| 129 |
# gradio open image as np array
|
| 130 |
#image_array = np.asarray(image_path)
|
| 131 |
#image = Image.fromarray(image_array, mode="RGB")
|
|
|
|
| 133 |
# prediction
|
| 134 |
with torch.no_grad():
|
| 135 |
out_final, image_bicubic = pred_SRCNN(
|
| 136 |
+
model=model, image=input_image, device=device
|
| 137 |
)
|
| 138 |
# grid = image_grid([out_final,image_bicubic],1,2)
|
| 139 |
return out_final, image_bicubic
|
|
|
|
| 150 |
description=description,
|
| 151 |
article=article,
|
| 152 |
examples=examples,
|
| 153 |
+
).launch()
|