Dricz commited on
Commit
c134122
1 Parent(s): be96225

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -30,14 +30,19 @@ def image_preprocess(image):
30
  model = YOLO('best (1).pt')
31
 
32
  def response(image):
33
- results = model(image)
34
- for i, r in enumerate(results):
 
35
  # Plot results image
36
  im_bgr = r.plot() # BGR-order numpy array
37
  im_rgb = im_bgr[..., ::-1] # Convert BGR to RGB
38
 
39
  # im_rgb = Image.fromarray(im_rgb)
40
- return im_rgb
 
 
 
 
41
 
42
  iface = gr.Interface(fn=response, inputs="image", outputs="image")
43
  iface.launch()
 
30
  model = YOLO('best (1).pt')
31
 
32
  def response(image):
33
+ print(image)
34
+ results = model(image)
35
+ for i, r in enumerate(results):
36
  # Plot results image
37
  im_bgr = r.plot() # BGR-order numpy array
38
  im_rgb = im_bgr[..., ::-1] # Convert BGR to RGB
39
 
40
  # im_rgb = Image.fromarray(im_rgb)
41
+
42
+ return im_rgb
43
+
44
+
45
+
46
 
47
  iface = gr.Interface(fn=response, inputs="image", outputs="image")
48
  iface.launch()