Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
|
4 |
|
5 |
from super_image import EdsrModel, ImageLoader
|
@@ -19,6 +19,7 @@ def transformation(image):
|
|
19 |
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=4)
|
20 |
inputs = ImageLoader.load_image(image)
|
21 |
preds = model(inputs)
|
|
|
22 |
print(preds)
|
23 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
24 |
ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')
|
@@ -32,7 +33,7 @@ with gr.Blocks() as demo:
|
|
32 |
image1=gr.Image(type='filepath')
|
33 |
|
34 |
button=gr.Button("LE BOUTON")
|
35 |
-
image2=gr.Image()
|
36 |
button.click(fn=transformation,inputs=image1,outputs=image2,api_name="upscale")
|
37 |
|
38 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import numpy as np
|
3 |
|
4 |
|
5 |
from super_image import EdsrModel, ImageLoader
|
|
|
19 |
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=4)
|
20 |
inputs = ImageLoader.load_image(image)
|
21 |
preds = model(inputs)
|
22 |
+
preds=np.array(preds)
|
23 |
print(preds)
|
24 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
25 |
ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')
|
|
|
33 |
image1=gr.Image(type='filepath')
|
34 |
|
35 |
button=gr.Button("LE BOUTON")
|
36 |
+
image2=gr.Image(type='numpy')
|
37 |
button.click(fn=transformation,inputs=image1,outputs=image2,api_name="upscale")
|
38 |
|
39 |
|