Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,14 +3,14 @@ import gradio as gr
|
|
| 3 |
from ultralytics import YOLO
|
| 4 |
|
| 5 |
# Load YOLOv8-Pose model (downloads if not cached)
|
| 6 |
-
model = YOLO("
|
| 7 |
|
| 8 |
def predict_pose(frame):
|
| 9 |
# Run YOLOv8-Pose inference
|
| 10 |
-
results = model.predict(frame, imgsz=
|
| 11 |
|
| 12 |
# Draw results on frame
|
| 13 |
-
annotated_frame = results.plot(labels=False) # YOLOv8 handles drawing
|
| 14 |
return annotated_frame
|
| 15 |
|
| 16 |
# Set up Gradio interface
|
|
|
|
| 3 |
from ultralytics import YOLO
|
| 4 |
|
| 5 |
# Load YOLOv8-Pose model (downloads if not cached)
|
| 6 |
+
model = YOLO("yolov8s-pose.pt") # You can also use yolov8s/m/l/x-pose.pt
|
| 7 |
|
| 8 |
def predict_pose(frame):
|
| 9 |
# Run YOLOv8-Pose inference
|
| 10 |
+
results = model.predict(frame, imgsz=640, conf=0.5, iou=0.5)[0]
|
| 11 |
|
| 12 |
# Draw results on frame
|
| 13 |
+
annotated_frame = results.plot(labels=False, boxes=False) # YOLOv8 handles drawing
|
| 14 |
return annotated_frame
|
| 15 |
|
| 16 |
# Set up Gradio interface
|