Skip to content

Commit

Permalink
Add simple yolo function
Browse files Browse the repository at this point in the history
  • Loading branch information
peik-etzell committed Nov 11, 2023
1 parent 0617472 commit d862ebb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions backend/yolo_model/yolo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from ultralytics import YOLO

model = YOLO("yolov8n-pose.pt")


def inference(input):
results_generator = model(source=input, conf=0.5, stream=True)
res = []
for frame in results_generator:
frame.orig_img = None # don't send back whole image
res.append(frame.numpy())
return res

0 comments on commit d862ebb

Please sign in to comment.