GithubHelp home page GithubHelp logo

monkut / deep_sort_pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zqpei/deep_sort_pytorch

0.0 1.0 0.0 23.61 MB

MOT tracking using deepsort and yolov3 with pytorch

License: GNU General Public License v3.0

Python 92.28% C++ 2.24% C 0.16% Cuda 3.06% Shell 0.03% Makefile 2.23%

deep_sort_pytorch's Introduction

Deep Sort with PyTorch

Introduction

This is an implementation of MOT (Multiple Object Tracking) tracking algorithm deep sort. Deep sort is basically the same with sort but has an added 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 using FasterRCNN, and the original source code is HERE.

This implementation replaces the tensorflow-based CNN modle with a PyTorch implementation, and replaces FasterRCNN with YOLOv3 for bbox generation.

Dependencies

  • python 3
  • numpy
  • scipy
  • opencv-python
  • sklearn
  • torch >= 0.4
  • torchvision >= 0.1
  • pillow
  • vizer
  • edict

Quick Start

Pre-requisites:

  1. Check all dependencies installed
pipenv install

# configure pre-commit hooks (black, isort)
pre-commit install
  1. Download YOLOv3 parameters

    make get-yolov3-weights

OR

cd detector/YOLOv3/weights/
wget https://pjreddie.com/media/files/yolov3.weights
wget https://pjreddie.com/media/files/yolov3-tiny.weights
cd ../../../
  1. Download deepsort parameters ckpt.t7
cd deep_sort/deep/checkpoint
# download ckpt.t7 from
https://drive.google.com/drive/folders/1xhG0kRH1EX5B9_Iz8gQJb7UNnn_riXi6 to this folder
cd ../../../
  1. Compile nms module
cd detector/YOLOv3/nms
sh build.sh
cd ../../..

Notice: If compiling failed, the simplist way is to **Upgrade your pytorch >= 1.1 and torchvision >= 0.3" and you can avoid the troublesome compiling problems which are most likely caused by either gcc version too low or libraries missing.

  1. Run demo
usage: python yolov3_deepsort.py VIDEO_PATH
                                [--help]
                                [--frame_interval FRAME_INTERVAL]
                                [--config_detection CONFIG_DETECTION]
                                [--config_deepsort CONFIG_DEEPSORT]
                                [--ignore_display]
                                [--display_width DISPLAY_WIDTH]
                                [--display_height DISPLAY_HEIGHT]
                                [--save_path SAVE_PATH]          
                                [--cpu]          

# yolov3 + deepsort
python yolov3_deepsort.py [VIDEO_PATH]

# yolov3_tiny + deepsort
python yolov3_deepsort.py [VIDEO_PATH] --config_detection ./configs/yolov3_tiny.yaml

# yolov3 + deepsort on webcam
python3 yolov3_deepsort.py /dev/video0 --camera 0

# yolov3_tiny + deepsort on webcam
python3 yolov3_deepsort.py /dev/video0 --config_detection ./configs/yolov3_tiny.yaml --camera 0

If you dont support X server, use --ignore_display to disable display. Results will be saved to ./demo/demo.avi.

All files above can also be accessed from BaiduDisk!
linker:BaiduDisk passwd:fbuw

Training the RE-ID model

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

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

Then you can try train.py to train your own parameter and evaluate it using test.py and evaluate.py. train.jpg

Demo videos and images

demo.avi demo2.avi

1.jpg 2.jpg

References

deep_sort_pytorch's People

Contributors

cclauss avatar cherishhh avatar joeyism avatar monkut avatar mrmanlu avatar theshadow29 avatar zqpei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.