Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?


Failed to load latest commit information.
Latest commit message
Commit time


New Features

  • Added Label for Every Track
  • Code can run on Both (CPU & GPU)
  • Video/WebCam/External Camera/IP Stream Supported

Coming Soon

  • Development of streamlit dashboard for Object Tracking

Ready to Use Google Colab

Steps to run Code

  • Clone the repository.
git clone
  • Goto the cloned folder.
cd yolov7-object-tracking
  • Create a virtual envirnoment (Recommended, If you dont want to disturb python packages)
### For Linux Users
python3 -m venv yolov7objtracking
source yolov7objtracking/bin/activate

### For Window Users
python3 -m venv yolov7objtracking
cd yolov7objtracking
cd Scripts
cd ..
cd ..
  • Upgrade pip with mentioned command below.
pip install --upgrade pip
  • Install requirements with mentioned command below.
pip install -r requirements.txt
  • Run the code with mentioned command below (by default, pretrained yolov7 weights will be automatically downloaded into the working directory if they don't already exist).
# for detection only
python --weights --source "your video.mp4"

#if you want to change source file
python --weights --source "your video.mp4"

#for specific class (person)
python --weights --source "your video.mp4" --classes 0

#for colored tracks 
python --weights --source "your video.mp4" --colored-trk

#for saving tracks centroid, track id and bbox coordinates
python --weights --source "your video.mp4" --save-txt --save-bbox-dim
  • Output file will be created in the working-dir/runs/detect/obj-tracking with original filename


YOLOv7 Detection Only YOLOv7 Object Tracking with ID YOLOv7 Object Tracking with ID and Label


My Medium Articles

For more details, you can reach out to me on Medium or can connect with me on LinkedIn