luanhailiang 2023-09-21 21:49:23 +08:00
parent 3940be3370
commit 51f4406c5b
1 changed files with 3 additions and 3 deletions

6
app.py
View File

@ -79,9 +79,9 @@ def worker(id,source,region=None,stream=False):
result = model.track(frame,show=False,stream=False,persist=True,device=int(id)%4)
result = result[0]
detections = sv.Detections.from_yolov8(result)
if result.boxes.id is not None:
detections.tracker_id = result.boxes.id.cpu().numpy().astype(int)
detections = detections[(detections.tracker_id is not None)]
# if result.boxes.id is not None:
# detections.tracker_id = result.boxes.id.cpu().numpy().astype(int)
# detections = detections[(detections.tracker_id is not None)]
count += 1
names = {}