nathanjc commited on
Commit
7392235
·
1 Parent(s): e945d2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -210,6 +210,8 @@ class options:
210
  self.no_trace=no_trace
211
 
212
  def get_output(input_image):
 
 
213
  input_image.save(f"{BASE_DIR}/input/image.jpg")
214
  source = f"{BASE_DIR}/input"
215
  opt = options(weights='logo_detection.pt',source=source)
@@ -222,5 +224,5 @@ def get_output(input_image):
222
  return input_image
223
 
224
 
225
- demo = gr.Interface(fn=get_output, type='pil', inputs="image", outputs="image")
226
  demo.launch(debug=True)
 
210
  self.no_trace=no_trace
211
 
212
  def get_output(input_image):
213
+ ### Numpy -> PIL
214
+ input_image = Image.fromarray(input_image).convert('RGB')
215
  input_image.save(f"{BASE_DIR}/input/image.jpg")
216
  source = f"{BASE_DIR}/input"
217
  opt = options(weights='logo_detection.pt',source=source)
 
224
  return input_image
225
 
226
 
227
+ demo = gr.Interface(fn=get_output, inputs="image", outputs="image")
228
  demo.launch(debug=True)