atalaydenknalbant commited on
Commit
8c94676
·
verified ·
1 Parent(s): 28751ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -16,13 +16,10 @@ def yolo_inference(images, model_id, conf_threshold, iou_threshold, max_detectio
16
  show_conf=True,
17
  )
18
 
19
- annotated_images = []
20
- for result in results:
21
- im_array = result.plot()
22
- im = Image.fromarray(im_array)
23
- annotated_images.append(im)
24
-
25
- return annotated_images
26
 
27
  interface = gr.Interface(
28
  fn=yolo_inference,
 
16
  show_conf=True,
17
  )
18
 
19
+ for r in results:
20
+ image_array = r.plot()
21
+ image = Image.fromarray(image_array[..., ::-1])
22
+ return image
 
 
 
23
 
24
  interface = gr.Interface(
25
  fn=yolo_inference,