Deep Sort with PyTorch

MOT tracking using deepsort and yolov3 with pytorch.

This is an implement of MOT tracking algorithm deep sort. Deep sort is basicly the same with sort but added a CNN model to extract features in image of human part bounded by a detector. This CNN model is indeed a RE-ID model and the detector used in PAPER is FasterRCNN , and the original source code is HERE.
However in original code, the CNN model is implemented with tensorflow, which I'm not familier with. SO I re-implemented the CNN feature extraction model with PyTorch, and changed the CNN model a little bit. Also, I use YOLOv3 to generate bboxes instead of FasterRCNN.



  • python 3 (python2 not sure)
  • numpy
  • scipy
  • opencv-python
  • sklearn
  • pytorch 0.4 or 1.x

Quick Start

  1. Check all dependencies installed
pip install -r requirements.txt

for user in china, you can specify pypi source to accelerate install like:

pip install -r requirements.txt -i 
  1. Clone this repository
git clone [email protected]:ZQPei/deep_sort_pytorch.git
  1. Download YOLOv3 parameters
cd YOLOv3/
cd ..
  1. Download deepsort parameters ckpt.t7
cd deep_sort/deep/checkpoint
# download ckpt.t7 from to this folder
cd ../../../
  1. Run demo
                              [--yolo_cfg YOLO_CFG]
                              [--yolo_weights YOLO_WEIGHTS]
                              [--yolo_names YOLO_NAMES]
                              [--conf_thresh CONF_THRESH]
                              [--nms_thresh NMS_THRESH]
                              [--deepsort_checkpoint DEEPSORT_CHECKPOINT]
                              [--max_dist MAX_DIST] [--ignore_display]
                              [--display_width DISPLAY_WIDTH]
                              [--display_height DISPLAY_HEIGHT]
                              [--save_path SAVE_PATH]          
                              [--use_cuda USE_CUDA]          

All files above can also be accessed from BaiduDisk!

Training the RE-ID model

The original model used in paper is in, and its parameter here original_ckpt.t7.

To train the model, first you need download Market1501 dataset or Mars dataset.

Then you can try to train your own parameter and evaluate it using and

Demo videos and images