Spaces:
Running
Running
File size: 678 Bytes
0e59ed2 aa749ff 0e59ed2 aa749ff 68bdcf9 aa749ff 0e59ed2 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import gradio as gr
from ultralytics import YOLO
model = YOLO("best.pt")
def greet(detection):
results = model(detection) # return a list of Results objects
for result in results:
boxes = result.boxes # Boxes object for bounding box outputs
masks = result.masks # Masks object for segmentation masks outputs
keypoints = result.keypoints # Keypoints object for pose outputs
probs = result.probs # Probs object for classification outputs
obb = result.obb # Oriented boxes object for OBB outputs
result.show() # display to screen
return result.show()
demo = gr.Interface(fn=greet, inputs="image", outputs="image")
demo.launch()
|