This is compatible only with ultralytics==8.0.0. However, I highly recommend using the latest version of the Ultralytics package and referring to the official Ultralytics codebase here: GitHub Repository.
- Clone the repository
https://github.com/RizwanMunawar/yolov8-object-tracking.git- Move to the cloned folder
cd yolov8-object-tracking- Install the ultralytics package
pip install ultralytics==8.0.0- Do tracking with the mentioned command below
#video file
python yolo\v8\detect\detect_and_trk.py model=yolov8s.pt source="test.mp4" show=True
#imagefile
python yolo\v8\detect\detect_and_trk.py model=yolov8m.pt source="path to image"
#Webcam
python yolo\v8\detect\detect_and_trk.py model=yolov8m.pt source=0 show=True
#External Camera
python yolo\v8\detect\detect_and_trk.py model=yolov8m.pt source=1 show=True- Output file will be created in the
runs/detect/trainwith the original filename
| YOLOv8s Object Tracking | YOLOv8m Object Tracking |
![]() |
![]() |
- 🔗 https://github.com/ultralytics/ultralytics
- 🔗 https://github.com/abewley/sort
- 🔗 https://docs.ultralytics.com/
Some of my articles/research papers | Computer vision awesome resources for learning | How do I appear to the world? 🚀
More Information
For more details, you can reach out to me on Medium or connect with me on LinkedIn

