brian25 commited on
Commit
68bdcf9
·
verified ·
1 Parent(s): aa749ff

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -5,7 +5,17 @@ from ultralytics import YOLO
5
  model = YOLO("best.pt")
6
 
7
  def greet(detection):
8
- return model(detection)
 
 
 
 
 
 
 
 
 
 
9
 
10
  demo = gr.Interface(fn=greet, inputs="image", outputs="image")
11
  demo.launch()
 
5
  model = YOLO("best.pt")
6
 
7
  def greet(detection):
8
+
9
+ results = model(detection) # return a list of Results objects
10
+
11
+ for result in results:
12
+ boxes = result.boxes # Boxes object for bounding box outputs
13
+ masks = result.masks # Masks object for segmentation masks outputs
14
+ keypoints = result.keypoints # Keypoints object for pose outputs
15
+ probs = result.probs # Probs object for classification outputs
16
+ obb = result.obb # Oriented boxes object for OBB outputs
17
+ result.show() # display to screen
18
+ return result.show()
19
 
20
  demo = gr.Interface(fn=greet, inputs="image", outputs="image")
21
  demo.launch()