Skip to content

YOLOv7 Segmentation using OpenCV and PyTorch with DeepSORT Tracking (ID + TRAILS)

License

Notifications You must be signed in to change notification settings

MuhammadMoinFaisal/yolov7-segmentation-with-DeepSORT-Tracking

Repository files navigation

YOLOv7 Segmentation with DeepSORT Tracking

I have implemented the YOLOv7 Segmantation with DeepSORT Tracking, please support by giving a star.

yolov7-seg.pt

Steps to run Code

  • Clone the repository
https://github.com/MuhammadMoinFaisal/yolov7-segmentation-with-DeepSORT-Tracking.git
  • Goto the cloned folder.
cd yolov7-segmentation-with-DeepSORT-Tracking
  • Create a virtual envirnoment (Recommended, If you dont want to disturb python packages)
### For Linux Users
python3 -m venv yolov7seg
source yolov7seg/bin/activate

### For Window Users
python3 -m venv yolov7seg
cd yolov7seg
cd Scripts
activate
cd ..
cd ..
  • Downloading the DeepSORT Files From The Google Drive
cd yolov7-segmentation-with-DeepSORT-Tracking
gdown "https://drive.google.com/uc?id=1BNZ1S5yflbQpbHeRM1fNeu_2WfuP17hJ&confirm=t"
unzip /content/yolov7-segmentation-with-DeepSORT-Tracking/deep_sort_pytorch.zip
  • Downloading a Sample Video from the Google Drive
gdown "https://drive.google.com/uc?id=1o-G_Fs-XtF_Nn_fQdri6GZWYtD_3_Ckw&confirm=t"
  • Upgrade pip with mentioned command below.
pip install --upgrade pip
  • Install requirements with mentioned command below.
pip install -r requirements.txt
  • Download weights from link and store in "yolov7-segmentation-with-DeepSORT-Tracking" directory.

  • Run the code with mentioned command below.

#for segmentation with detection + Tracking
python3 segment/predict.py --source videosfinal.mp4 --weights yolov7-seg.pt --track
  • Output file will be created in the working directory with name runs/predict-seg/exp/"original-video-name.mp4"

Colab File Link

The google colab file link is provided below, you can check the implementation in Google Colab, and its a single click implementation, you just need to select the Run Time as GPU, and click on Run All.

Google Colab File

DeepSORT Files

The DeepSORT files are uplaoded in the Google Drive Link Below. DeepSORT Files

RESULTS

Vehicles Semantic Segmentation

Vehicles Sematic Segmentation

Vehicles Semantic Segmentation

References