TalalAhmed311 / Object-Tracking-Counter

68 stars 25 forks source link

not an issue but question #2

Closed zeesh1979 closed 1 year ago

zeesh1979 commented 1 year ago

how we can do this with live video from webcam? i plan to run it on raspberry pi and connect webcam to one of the USB ports also how i can train my own model to detect other type of objects?

TalalAhmed311 commented 1 year ago

First, train your custom model using yolov5. Custom Model training tutorial:

https://github.com/ultralytics/yolov5/wiki/Train-Custom-Data

For live video or webcam, you have to tweak the inference command

Webcam

python tracker.py --source 0 --weights <YOUR WEIGHTS FILE> --show-vid

Raspbery Pi

python tracker.py --source <YOUR IP CAM ADDRESS> --weights <YOUR WEIGHTS FILE> --show-vid

change --source and place your weights file which comes after training.