MOT using deepsort yolov5 with ascend
Requirement | Version |
---|---|
OS | Ubuntu 18.04 |
OpenCV | 4.x compiled with GCC 7.5 |
OpenMP | default with GCC |
CANN | 3.3.0 or above |
supported Ascend Hardware:Atlas300-3000/3010、Atlas800-3000/3010
Hardware | e2e latency(10 tracks) | FPS |
---|---|---|
Ascend310 | 50ms | 20 |
yolov5m model can be download here:
链接:https://pan.baidu.com/s/1eZ9GBjEFgSIx-ayjzYzCBQ 提取码:1234
python3 modify_yolov5.py yolov5m.onnx yolov5m
source /usr/local/Ascend/ascend-toolkit/set_env.sh
atc --model=yolov5m.onnx --framework=5 --output=yolov5m --soc_version=Ascend310 --insert_op_conf=aipp_rgb_yolo.cfg --input_format=NCHW --input_shape="images:1,3,640,640" --out_nodes="Conv_266:0;Conv_282:0;Conv_298:0" --output_type="Conv_266:0:FP32;Conv_282:0:FP32;Conv_298:0:FP32"
param | statement |
---|---|
--model | input onnx model |
--output | output om file |
--input_shape | model input shape: (batch, channel, width, height) |
--out_nodes | select model output nodes, node's name in onnx graph |
--output_type | define model output nodes' type, the node must corresponding to the items which out_nodes defined |
which nodes you should select:
feature extractor model can be download here
链接:https://pan.baidu.com/s/1nEfb3Yd0n32fHj9C9QdqQw 提取码:1234
source /usr/local/Ascend/ascend-toolkit/set_env.sh
atc --model=feature.onnx --framework=5 --output=feature --soc_version=Ascend310 --insert_op_conf=aipp_rgb_feature.cfg --input_format=NCHW --input_shape="input:1,3,128,64"
set(OpenCV_DIR /root/opencv4.4/lib/cmake/opencv4) #your own opencv path
...
set(ACL_PATH /usr/local/Ascend/ascend-toolkit/latest) #your own cann-toolkit path
mkdir build
cd build
cmake ..
make -j8
./ACL_DEEPSORT model/yolov5m.om model/feature.om data/test.mp4
===============================
yolov5 infer time:20.759ms
Detections size:9
feature infer time:13.906ms
predict time:0.693ms
update time:11.268ms
fps:21.3538
===============================
DeepSORT: https://github.com/shaoshengsong/DeepSORT
Yolov5_DeepSort_Pytorch: https://github.com/mikel-brostrom/Yolov5_DeepSort_Pytorch