beihai commited on
Commit
bec83c3
1 Parent(s): 78bb9d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -1,7 +1,7 @@
1
  from xml.dom.pulldom import default_bufsize
2
  import os
3
  os.system("pip install opencv-python")
4
- import cv2
5
  import numpy as np
6
  from PIL import Image
7
  import gradio as gr
@@ -9,7 +9,8 @@ from func import rebuild_img
9
 
10
 
11
  def inference(img,k):
12
- input_img = cv2.imread(img, cv2.IMREAD_COLOR)
 
13
  #k=gr.inputs.Slider(0, 1, 0.1)
14
  u, sigma, v = np.linalg.svd(input_img[:, :, 0])
15
  R = rebuild_img(u, sigma, v, k)
 
1
  from xml.dom.pulldom import default_bufsize
2
  import os
3
  os.system("pip install opencv-python")
4
+ #import cv2
5
  import numpy as np
6
  from PIL import Image
7
  import gradio as gr
 
9
 
10
 
11
  def inference(img,k):
12
+ #input_img = cv2.imread(img, cv2.IMREAD_COLOR)
13
+ input_img = Image.open(img)
14
  #k=gr.inputs.Slider(0, 1, 0.1)
15
  u, sigma, v = np.linalg.svd(input_img[:, :, 0])
16
  R = rebuild_img(u, sigma, v, k)