参考《PP-Tracking之手把手玩转多目标跟踪》运行多目标跟踪示例失败,报错AssertionError: MTMCT only support single class.
问题确认 Search before asking
bug描述 Describe the Bug
步骤一,下载预测部署模型:
!wget https://paddledet.bj.bcebos.com/models/mot/deepsort/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle.tar
!wget https://paddledet.bj.bcebos.com/models/mot/deepsort/deepsort_pplcnet_vehicle.tar
!cd ~/PaddleDetection/ && mkdir -p output_inference
!mv ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle.tar ~/PaddleDetection/output_inference
!mv deepsort_pplcnet_vehicle.tar ~/PaddleDetection/output_inference
!cd ~/PaddleDetection/output_inference && tar -xvf ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle.tar && tar -xvf deepsort_pplcnet_vehicle.tar
步骤二,完成跨镜跟踪预测 在完成模型下载后,需要修改PaddleDetection/deploy/pptracking/python路径下的mtmct_cfg.yml,这份配置文件中包含了跨镜跟踪中轨迹融合的相关参数。首先需要确定cameras_bias中对应的名称与输入视频名称对应;其次,我们本次项目使用轨迹融合中的通用方法,将zone和camera相关的方法设置为False。修改后配置如下:
# config for MTMCT
MTMCT: True
cameras_bias:
c003: 0
c004: 0
# 1.zone releated parameters
use_zone: False #True
zone_path: dataset/mot/aic21mtmct_vehicle/S06/zone
# 2.tricks parameters, can be used for other mtmct dataset
use_ff: True
use_rerank: True
# 3.camera releated parameters
use_camera: False #True
use_st_filter: False
# 4.zone releated parameters
use_roi: False #True
roi_dir: dataset/mot/aic21mtmct_vehicle/S06
配置完成后即可运行如下命令,输入视频为c003.mp4和c004.mp4两个不同视角的摄像头拍摄结果。
!wget https://bj.bcebos.com/v1/paddledet/data/mot/demo/mtmct-demo.tar && mv mtmct-demo.tar ~/PaddleDetection && cd ~/PaddleDetection && tar xvf mtmct-demo.tar
!cd ~/PaddleDetection && python deploy/pptracking/python/mot_sde_infer.py --model_dir=output_inference/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle/ --reid_model_dir=output_inference/deepsort_pplcnet_vehicle/ --mtmct_dir=./mtmct-demo --device=GPU --mtmct_cfg=deploy/pptracking/python/mtmct_cfg.yml --scaled=True --save_mot_txts --save_images
运行报错:
----------- Running Arguments -----------
batch_size: 1
camera_id: -1
cpu_threads: 1
device: GPU
do_entrance_counting: False
draw_center_traj: False
enable_mkldnn: False
image_dir: None
image_file: None
model_dir: output_inference/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle/
mtmct_cfg: deploy/pptracking/python/mtmct_cfg.yml
mtmct_dir: ./mtmct-demo
output_dir: output
reid_batch_size: 50
reid_model_dir: output_inference/deepsort_pplcnet_vehicle/
run_benchmark: False
run_mode: paddle
save_images: True
save_mot_txt_per_img: False
save_mot_txts: True
scaled: True
secs_interval: 2
threshold: 0.5
tracker_config: deploy/pptracking/python/tracker_config.yml
trt_calib_mode: False
trt_max_shape: 1280
trt_min_shape: 1
trt_opt_shape: 640
use_dark: True
use_gpu: False
video_file: None
------------------------------------------
----------- Model Configuration -----------
Model Arch: YOLO
Transform Order:
--transform op: Resize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
----------- Model Configuration -----------
Model Arch: DeepSORT
Transform Order:
--transform op: LetterBoxResize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
ffmpeg processing of video ./mtmct-demo/c003.mp4
start tracking seq: c003
Tracking frame: 0
Traceback (most recent call last):
File "deploy/pptracking/python/mot_sde_infer.py", line 755, in <module>
main()
File "deploy/pptracking/python/mot_sde_infer.py", line 724, in main
detector.predict_mtmct(FLAGS.mtmct_dir, mtmct_cfg)
File "deploy/pptracking/python/mot_sde_infer.py", line 638, in predict_mtmct
mot_features_dict = self.predict_image(
File "deploy/pptracking/python/mot_sde_infer.py", line 418, in predict_image
tracking_outs = self.tracking(det_result)
File "deploy/pptracking/python/mot_sde_infer.py", line 312, in tracking
assert self.num_classes == 1, 'MTMCT only support single class.'
AssertionError: MTMCT only support single class.
复现环境 Environment
- paddlepaddle-gpu:2.2.2
- paddledet:2.4.2
- cuda:10.2
是否愿意提交PR Are you willing to submit a PR?
- [ ] Yes I'd like to help by submitting a PR!
代码用release/2.3试试,这是当时课程的版本。目前版本的问题我们会尽快修复。
一样的问题啊
多谢,我试试先
请问大家在更新版本后问题是否得到解决?
@nemonameless 切换成releas/2.3后,运行通过,但是出现新的错误,以下是运行日志
----------- Running Arguments -----------
batch_size: 1
camera_id: -1
cpu_threads: 1
device: GPU
do_entrance_counting: False
draw_center_traj: False
enable_mkldnn: False
image_dir: None
image_file: None
model_dir: output_inference/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle/
mtmct_cfg: deploy/pptracking/python/mtmct_cfg.yml
mtmct_dir: ./mtmct-demo
output_dir: output
reid_batch_size: 50
reid_model_dir: output_inference/deepsort_pplcnet_vehicle/
run_benchmark: False
run_mode: paddle
save_images: True
save_mot_txts: True
scaled: True
secs_interval: 2
threshold: 0.5
trt_calib_mode: False
trt_max_shape: 1280
trt_min_shape: 1
trt_opt_shape: 640
video_file: None
------------------------------------------
----------- Model Configuration -----------
Model Arch: YOLO
Transform Order:
--transform op: Resize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
----------- Model Configuration -----------
Model Arch: DeepSORT
Transform Order:
--transform op: LetterBoxResize
--transform op: NormalizeImage
--transform op: Permute
--------------------------------------------
Totally 102 frames found in seq c003.
Processing frame 0 of seq c003.
Processing frame 10 of seq c003.
Processing frame 20 of seq c003.
Processing frame 30 of seq c003.
Processing frame 40 of seq c003.
Processing frame 50 of seq c003.
Processing frame 60 of seq c003.
Processing frame 70 of seq c003.
Processing frame 80 of seq c003.
Processing frame 90 of seq c003.
Processing frame 100 of seq c003.
MOT results save in output/c003.txt
ffmpeg processing of video ./mtmct-demo/c003.mp4
Totally 102 frames found in seq c003.
Processing frame 0 of seq c003.
Processing frame 10 of seq c003.
Processing frame 20 of seq c003.
Processing frame 30 of seq c003.
Processing frame 40 of seq c003.
Processing frame 50 of seq c003.
Processing frame 60 of seq c003.
Processing frame 70 of seq c003.
Processing frame 80 of seq c003.
Processing frame 90 of seq c003.
Processing frame 100 of seq c003.
MOT results save in output/c003.txt
ffmpeg processing of video ./mtmct-demo/c004.mp4
Totally 102 frames found in seq c004.
Processing frame 0 of seq c004.
Processing frame 10 of seq c004.
Processing frame 20 of seq c004.
Processing frame 30 of seq c004.
Processing frame 40 of seq c004.
Processing frame 50 of seq c004.
Processing frame 60 of seq c004.
Processing frame 70 of seq c004.
Processing frame 80 of seq c004.
Processing frame 90 of seq c004.
Processing frame 100 of seq c004.
MOT results save in output/c004.txt
current use ff finetuned parameters....
feat3:0/74
feat3:0/74
current use rerank finetuned parameters....
100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1918.25it/s]
100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16505.98it/s]
100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5933.22it/s]
current use ff finetuned parameters....
feat3:0/74
feat3:0/74
current use rerank finetuned parameters....
100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1689.10it/s]
100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16597.34it/s]
100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5735.22it/s]
Traceback (most recent call last):
File "deploy/pptracking/python/mot_sde_infer.py", line 1110, in <module>
main()
File "deploy/pptracking/python/mot_sde_infer.py", line 1059, in main
predict_mtmct(
File "deploy/pptracking/python/mot_sde_infer.py", line 922, in predict_mtmct
gen_res(
File "PaddleDetection-release-2.3/deploy/pptracking/python/mot/mtmct/postprocess.py", line 142, in gen_res
cid = scene_cluster[idx]
IndexError: list index out of range
代码用release/2.3试试,这是当时课程的版本。目前版本的问题我们会尽快修复。
请问修复了么?
我也是這個的問題
代码用release/2.3试试,这是当时课程的版本。目前版本的问题我们会尽快修复。
请问修复了么?
原问题修复了,但有新的问题,见前面的回复内容
问题已经解决,在ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle文件夹中的infer_cfg.yml 文件中,删除label_list中除car以外的类别,一共八十类,但是我们只需要一类
删除ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle文件夹中的infer_cfg.yml 文件中label_list里除car以外的类别,建议直接删除代码,我尝试过注释掉其他类别,但还会报同样的错
@nemonameless 切换成releas/2.3后,运行通过,但是出现新的错误,以下是运行日志
----------- Running Arguments ----------- batch_size: 1 camera_id: -1 cpu_threads: 1 device: GPU do_entrance_counting: False draw_center_traj: False enable_mkldnn: False image_dir: None image_file: None model_dir: output_inference/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle/ mtmct_cfg: deploy/pptracking/python/mtmct_cfg.yml mtmct_dir: ./mtmct-demo output_dir: output reid_batch_size: 50 reid_model_dir: output_inference/deepsort_pplcnet_vehicle/ run_benchmark: False run_mode: paddle save_images: True save_mot_txts: True scaled: True secs_interval: 2 threshold: 0.5 trt_calib_mode: False trt_max_shape: 1280 trt_min_shape: 1 trt_opt_shape: 640 video_file: None ------------------------------------------ ----------- Model Configuration ----------- Model Arch: YOLO Transform Order: --transform op: Resize --transform op: NormalizeImage --transform op: Permute -------------------------------------------- ----------- Model Configuration ----------- Model Arch: DeepSORT Transform Order: --transform op: LetterBoxResize --transform op: NormalizeImage --transform op: Permute -------------------------------------------- Totally 102 frames found in seq c003. Processing frame 0 of seq c003. Processing frame 10 of seq c003. Processing frame 20 of seq c003. Processing frame 30 of seq c003. Processing frame 40 of seq c003. Processing frame 50 of seq c003. Processing frame 60 of seq c003. Processing frame 70 of seq c003. Processing frame 80 of seq c003. Processing frame 90 of seq c003. Processing frame 100 of seq c003. MOT results save in output/c003.txt ffmpeg processing of video ./mtmct-demo/c003.mp4 Totally 102 frames found in seq c003. Processing frame 0 of seq c003. Processing frame 10 of seq c003. Processing frame 20 of seq c003. Processing frame 30 of seq c003. Processing frame 40 of seq c003. Processing frame 50 of seq c003. Processing frame 60 of seq c003. Processing frame 70 of seq c003. Processing frame 80 of seq c003. Processing frame 90 of seq c003. Processing frame 100 of seq c003. MOT results save in output/c003.txt ffmpeg processing of video ./mtmct-demo/c004.mp4 Totally 102 frames found in seq c004. Processing frame 0 of seq c004. Processing frame 10 of seq c004. Processing frame 20 of seq c004. Processing frame 30 of seq c004. Processing frame 40 of seq c004. Processing frame 50 of seq c004. Processing frame 60 of seq c004. Processing frame 70 of seq c004. Processing frame 80 of seq c004. Processing frame 90 of seq c004. Processing frame 100 of seq c004. MOT results save in output/c004.txt current use ff finetuned parameters.... feat3:0/74 feat3:0/74 current use rerank finetuned parameters.... 100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1918.25it/s] 100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16505.98it/s] 100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5933.22it/s] current use ff finetuned parameters.... feat3:0/74 feat3:0/74 current use rerank finetuned parameters.... 100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1689.10it/s] 100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16597.34it/s] 100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5735.22it/s] Traceback (most recent call last): File "deploy/pptracking/python/mot_sde_infer.py", line 1110, in <module> main() File "deploy/pptracking/python/mot_sde_infer.py", line 1059, in main predict_mtmct( File "deploy/pptracking/python/mot_sde_infer.py", line 922, in predict_mtmct gen_res( File "PaddleDetection-release-2.3/deploy/pptracking/python/mot/mtmct/postprocess.py", line 142, in gen_res cid = scene_cluster[idx] IndexError: list index out of range
我也遇到的IndexError: list index out of range的问题,请问楼主现在这个问题解决了嘛
@nemonameless 切换成releas/2.3后,运行通过,但是出现新的错误,以下是运行日志
----------- Running Arguments ----------- batch_size: 1 camera_id: -1 cpu_threads: 1 device: GPU do_entrance_counting: False draw_center_traj: False enable_mkldnn: False image_dir: None image_file: None model_dir: output_inference/ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle/ mtmct_cfg: deploy/pptracking/python/mtmct_cfg.yml mtmct_dir: ./mtmct-demo output_dir: output reid_batch_size: 50 reid_model_dir: output_inference/deepsort_pplcnet_vehicle/ run_benchmark: False run_mode: paddle save_images: True save_mot_txts: True scaled: True secs_interval: 2 threshold: 0.5 trt_calib_mode: False trt_max_shape: 1280 trt_min_shape: 1 trt_opt_shape: 640 video_file: None ------------------------------------------ ----------- Model Configuration ----------- Model Arch: YOLO Transform Order: --transform op: Resize --transform op: NormalizeImage --transform op: Permute -------------------------------------------- ----------- Model Configuration ----------- Model Arch: DeepSORT Transform Order: --transform op: LetterBoxResize --transform op: NormalizeImage --transform op: Permute -------------------------------------------- Totally 102 frames found in seq c003. Processing frame 0 of seq c003. Processing frame 10 of seq c003. Processing frame 20 of seq c003. Processing frame 30 of seq c003. Processing frame 40 of seq c003. Processing frame 50 of seq c003. Processing frame 60 of seq c003. Processing frame 70 of seq c003. Processing frame 80 of seq c003. Processing frame 90 of seq c003. Processing frame 100 of seq c003. MOT results save in output/c003.txt ffmpeg processing of video ./mtmct-demo/c003.mp4 Totally 102 frames found in seq c003. Processing frame 0 of seq c003. Processing frame 10 of seq c003. Processing frame 20 of seq c003. Processing frame 30 of seq c003. Processing frame 40 of seq c003. Processing frame 50 of seq c003. Processing frame 60 of seq c003. Processing frame 70 of seq c003. Processing frame 80 of seq c003. Processing frame 90 of seq c003. Processing frame 100 of seq c003. MOT results save in output/c003.txt ffmpeg processing of video ./mtmct-demo/c004.mp4 Totally 102 frames found in seq c004. Processing frame 0 of seq c004. Processing frame 10 of seq c004. Processing frame 20 of seq c004. Processing frame 30 of seq c004. Processing frame 40 of seq c004. Processing frame 50 of seq c004. Processing frame 60 of seq c004. Processing frame 70 of seq c004. Processing frame 80 of seq c004. Processing frame 90 of seq c004. Processing frame 100 of seq c004. MOT results save in output/c004.txt current use ff finetuned parameters.... feat3:0/74 feat3:0/74 current use rerank finetuned parameters.... 100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1918.25it/s] 100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16505.98it/s] 100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5933.22it/s] current use ff finetuned parameters.... feat3:0/74 feat3:0/74 current use rerank finetuned parameters.... 100%|███████████████████████████████████████| 148/148 [00:00<00:00, 1689.10it/s] 100%|██████████████████████████████████████| 148/148 [00:00<00:00, 16597.34it/s] 100%|█████████████████████████████████████████| 74/74 [00:00<00:00, 5735.22it/s] Traceback (most recent call last): File "deploy/pptracking/python/mot_sde_infer.py", line 1110, in <module> main() File "deploy/pptracking/python/mot_sde_infer.py", line 1059, in main predict_mtmct( File "deploy/pptracking/python/mot_sde_infer.py", line 922, in predict_mtmct gen_res( File "PaddleDetection-release-2.3/deploy/pptracking/python/mot/mtmct/postprocess.py", line 142, in gen_res cid = scene_cluster[idx] IndexError: list index out of range我也遇到的IndexError: list index out of range的问题,请问楼主现在这个问题解决了嘛
https://github.com/PaddlePaddle/PaddleDetection/issues/6649#issuecomment-1218980217 我照这里面的回答解决了
问题已经解决,在ppyolov2_r50vd_dcn_365e_aic21mtmct_vehicle文件夹中的infer_cfg.yml 文件中,删除label_list中除car以外的类别,一共八十类,但是我们只需要一类
请问我在ppyolov2的配置文件infer_cfg.yml中只保留了car这一类别,为什么在得到的可视化结果内检测器对交通信号灯及其他物体进行检测?

以前在百度提供的环境里是提供数据集的,好久没看过了 ,您可以尝试下百度的环境
在 2025-02-20 14:56:29,"geoxpert0001" @.***> 写道:
你好 想請問MCMT 數據集 哪邊可以下載的到? 其實我只要原始video 文件就好,我只是要拿來測試,但苦無找不到下載link? 不知道是否官方有提供? AI CITY 申請都沒過,所以才來這邊詢問大家,謝謝
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
geoxpert0001 left a comment (PaddlePaddle/PaddleDetection#5967)
你好 想請問MCMT 數據集 哪邊可以下載的到? 其實我只要原始video 文件就好,我只是要拿來測試,但苦無找不到下載link? 不知道是否官方有提供? AI CITY 申請都沒過,所以才來這邊詢問大家,謝謝
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
以前在百度提供的环境里是提供数据集的,好久没看过了 ,您可以尝试下百度的环境
在 2025-02-20 14:56:29,"geoxpert0001" @.***> 写道:
你好 想請問MCMT 數據集 哪邊可以下載的到? 其實我只要原始video 文件就好,我只是要拿來測試,但苦無找不到下載link? 不知道是否官方有提供? AI CITY 申請都沒過,所以才來這邊詢問大家,謝謝
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
geoxpert0001 left a comment (PaddlePaddle/PaddleDetection#5967)
你好 想請問MCMT 數據集 哪邊可以下載的到? 其實我只要原始video 文件就好,我只是要拿來測試,但苦無找不到下載link? 不知道是否官方有提供? AI CITY 申請都沒過,所以才來這邊詢問大家,謝謝
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
https://bj.bcebos.com/v1/paddledet/data/mot/demo/mtmct-demo.tar 这个就是Video文件