rdezwart commited on
Commit
0a5c36c
·
1 Parent(s): 1dc8ee5

Change YOLOS output from image to gallery of images

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -66,7 +66,7 @@ def detect_objects(img: Image.Image):
66
  )
67
  box_images.append(img.crop((box[0], box[1], box[2], box[3])))
68
 
69
- return box_images[0]
70
 
71
 
72
  if __name__ == "__main__":
@@ -82,7 +82,7 @@ if __name__ == "__main__":
82
  with gr.Tab("Object Detection"):
83
  with gr.Row():
84
  yolos_input = gr.Image(type="pil")
85
- yolos_output = gr.Image()
86
  yolos_button = gr.Button("Submit")
87
 
88
  with gr.Tab("Inference"):
 
66
  )
67
  box_images.append(img.crop((box[0], box[1], box[2], box[3])))
68
 
69
+ return box_images
70
 
71
 
72
  if __name__ == "__main__":
 
82
  with gr.Tab("Object Detection"):
83
  with gr.Row():
84
  yolos_input = gr.Image(type="pil")
85
+ yolos_output = gr.Gallery(label="Detected Objects", show_label=True)
86
  yolos_button = gr.Button("Submit")
87
 
88
  with gr.Tab("Inference"):