Hu commited on
Commit
a5d83a9
·
1 Parent(s): 2175206

change PIL load image

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -54,8 +54,8 @@ def pred_SRCNN(model, image, device, scale_factor=2):
54
  model.to(device)
55
  model.eval()
56
 
57
- # open image
58
- # image = Image.open(image_path)
59
  # split channels
60
  y, cb, cr = image.convert("YCbCr").split()
61
  # size will be used in image transform
@@ -127,8 +127,8 @@ model.eval()
127
 
128
  def super_reso(image_path):
129
  # gradio open image as np array
130
- image_array = np.asarray(image_path)
131
- image = Image.fromarray(image_array, mode="RGB")
132
 
133
  # prediction
134
  with torch.no_grad():
 
54
  model.to(device)
55
  model.eval()
56
 
57
+ # open image, gradio opens image as nparray
58
+ image = Image.fromarray(image)
59
  # split channels
60
  y, cb, cr = image.convert("YCbCr").split()
61
  # size will be used in image transform
 
127
 
128
  def super_reso(image_path):
129
  # gradio open image as np array
130
+ #image_array = np.asarray(image_path)
131
+ #image = Image.fromarray(image_array, mode="RGB")
132
 
133
  # prediction
134
  with torch.no_grad():