Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -4,17 +4,10 @@ from ultralytics import YOLO
|
|
4 |
|
5 |
model = YOLO("best.pt")
|
6 |
|
7 |
-
def greet(
|
8 |
|
9 |
-
|
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")
|
|
|
4 |
|
5 |
model = YOLO("best.pt")
|
6 |
|
7 |
+
def greet(source):
|
8 |
|
9 |
+
result = model(source) # return a list of Results objects
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
return result.show()
|
12 |
|
13 |
demo = gr.Interface(fn=greet, inputs="image", outputs="image")
|