Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get track_id #30

Open
sunnysab opened this issue Jul 14, 2024 · 0 comments
Open

Could not get track_id #30

sunnysab opened this issue Jul 14, 2024 · 0 comments

Comments

@sunnysab
Copy link

Hello, I've downloaded yolov8n-face.pt provided at your link, while I found that result.boxes.id is always None. It leads tracking unavailable.

I tested other face detecting model, all are the same. It's really confusing me.

The code is here:

import cv2
from ultralytics import YOLO


_DETECTOR_MODEL = YOLO('yolov8n-face.pt')

if __name__ == '__main__':
    video = '/home/sunnysab/测试视频4_大门_买饭回.mp4'
    stream = cv2.VideoCapture(video)

    while True:
        ret, frame = stream.read()
        if not ret:
            break

        results = _DETECTOR_MODEL.track(frame, conf=0.3, persist=True)
        result = results[0]

        if result.boxes.id:
            print('id = ', result.boxes.id.int().cuda().tolist())
            print(result.boxes.xywh)
            print(result.boxes.id)

        annotated_frame = result.plot()
        cv2.imshow('frame', annotated_frame)

        if cv2.waitKey(1) & 0xFF == ord('q'):
            exit(0)

Looking forward to receiving your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant