Kev09 commited on
Commit
bf2220c
1 Parent(s): fbc62a1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- 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')
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