Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
import numpy as np
|
3 |
|
4 |
|
|
|
5 |
from super_image import EdsrModel, ImageLoader
|
6 |
from PIL import Image
|
7 |
import requests
|
@@ -19,8 +20,13 @@ def transformation(image):
|
|
19 |
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=4)
|
20 |
inputs = ImageLoader.load_image(image)
|
21 |
preds = model(inputs)
|
22 |
-
|
23 |
-
print(preds)
|
|
|
|
|
|
|
|
|
|
|
24 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
25 |
ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')
|
26 |
|
|
|
2 |
import numpy as np
|
3 |
|
4 |
|
5 |
+
import torch
|
6 |
from super_image import EdsrModel, ImageLoader
|
7 |
from PIL import Image
|
8 |
import requests
|
|
|
20 |
model = EdsrModel.from_pretrained('eugenesiow/edsr-base', scale=4)
|
21 |
inputs = ImageLoader.load_image(image)
|
22 |
preds = model(inputs)
|
23 |
+
print("1 :",preds)
|
24 |
+
print( type(preds) )
|
25 |
+
preds=preds.numpy()
|
26 |
+
|
27 |
+
|
28 |
+
#preds=np.array(preds)
|
29 |
+
print("2 :",preds)
|
30 |
ImageLoader.save_image(preds, './scaled_2x.png')
|
31 |
ImageLoader.save_compare(inputs, preds, './scaled_2x_compare.png')
|
32 |
|