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

Can this project detect cars and some moving objects but people? #1

Open
zhongqiu1245 opened this issue May 25, 2024 · 1 comment
Open

Comments

@zhongqiu1245
Copy link

zhongqiu1245 commented May 25, 2024

Thank you!

@zhongqiu1245 zhongqiu1245 changed the title Can this projext Can this project detect cars and some moving objects but people? May 25, 2024
@TomasMendozaHN
Copy link

TomasMendozaHN commented Sep 25, 2024

Assuming the moving object(s) you want to track are inside of Coco dataset , then all you have to do is go to main.py, search for this line:

if object_classes[i] != 0: # 0 is for person class (COCO)

and change 0 to the corresponding class or classes that you want to track.
For example, assuming you want to track cars you would modify to:
if object_classes[i] != 3: # 3 is for car class (COCO)

or if you want to track cars and motorcycles you would modify to this:
if object_classes[i] not in [3, 4]: # 3 is for car, 4 is for motorcycle class (COCO)

In case you want to track objects outside Coco, then I would suggest training your own YOLO v8 model on your custom dataset, then just load your own weights:

model = torch.load('your_weights.pt', map_location='cuda')['model'].float()

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

2 participants