Check all dependencies installed
pip3 install -r requirements.txt
for user in china, you can specify pypi source to accelerate install like:
pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Clone this repository
git clone https://github.com/derek285/yolov4_deep_sort_pytorch.git
Download YOLOv4 parameters
wget yolov4.weights and cfg
//并且重命名为4.cfg 和 4.weights 这个hard code有点山寨了:detector/v4detector.py :
configPath = "4.cfg"
weightPath = "4.weights"
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 ../../../
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
.
usage: python tracker.py VIDEO_PATH
[--help]
[--frame_interval FRAME_INTERVAL]
[--config_detection CONFIG_DETECTION]
[--config_deepsort CONFIG_DEEPSORT]
[--display]
[--display_width DISPLAY_WIDTH]
[--display_height DISPLAY_HEIGHT]
[--save_path SAVE_PATH]
[--cpu]
python3 tracker.py VIDEO_PATH
python3 tracker.py /dev/video0 --camera 0
1. get class_id return
2. fix depends on libdarknet.so