Clone the repository:
git clone https://github.com/RizwanMunawar/yolov7-object-tracking.git
Navigate to the cloned folder:
cd yolov7-object-tracking
Create a virtual environment (Recommended to avoid conflicts):
conda create -n yolov7objtracking python=3.10
conda activate yolov7objtracking
python3 -m venv yolov7objtracking
source yolov7objtracking/bin/activate
python3 -m venv yolov7objtracking
cd yolov7objtracking/Scripts
activate
Update pip and install dependencies:
pip install --upgrade pip
pip install -r requirements.txt
Run the script:
Select the appropriate command based on your requirements. Pretrained yolov7 weights will be downloaded automatically if needed.
Detection only:
python detect.py --weights yolov7.pt --source "your video.mp4"
Object tracking:
python detect_and_track.py --weights yolov7.pt --source "your video.mp4"
Webcam:
python detect_and_track.py --weights yolov7.pt --source 0
External Camera:
python detect_and_track.py --weights yolov7.pt --source 1
IP Camera Stream:
python detect_and_track.py --source "your IP Camera Stream URL" --device 0
Specific class tracking (e.g., person):
python detect_and_track.py --weights yolov7.pt --source "your video.mp4" --classes 0
Colored tracks:
python detect_and_track.py --weights yolov7.pt --source "your video.mp4" --colored-trk
Save track centroids, IDs, and bounding box coordinates:
python detect_and_track.py --weights yolov7.pt --source "your video.mp4" --save-txt --save-bbox-dim
Output files will be saved in working-dir/runs/detect/obj-tracking
with the original filename.
YOLOv7 Detection Only | YOLOv7 Object Tracking with ID | YOLOv7 Object Tracking with ID and Label |
Some of my articles/research papers | computer vision awesome resources for learning | How do I appear to the world? 🚀
Ultralytics YOLO11: Object Detection and Instance Segmentation🤯
Parking Management using Ultralytics YOLO11
My 🖐️Computer Vision Hobby Projects that Yielded Earnings
Best Resources to Learn Computer Vision
Roadmap for Computer Vision Engineer
How did I spend 2022 in the Computer Vision Field
Domain Feature Mapping with YOLOv7 for Automated Edge-Based Pallet Racking Inspections
Exudate Regeneration for Automated Exudate Detection in Retinal Fundus Images
Feature Mapping for Rice Leaf Defect Detection Based on a Custom Convolutional Architecture
Yolov5, Yolo-x, Yolo-r, Yolov7 Performance Comparison: A Survey
Explainable AI in Drug Sensitivity Prediction on Cancer Cell Lines