Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用DeepSORT模型评估,采用经过匹配之后的检测框结果det_results_dir报错 #9238

Open
3 tasks done
ilovefanjian opened this issue Dec 11, 2024 · 7 comments
Assignees

Comments

@ilovefanjian
Copy link

问题确认 Search before asking

  • 我已经查询历史issue,没有发现相似的bug。I have searched the issues and found no similar bug report.

Bug组件 Bug Component

No response

Bug描述 Describe the Bug

使用python tools/eval_mot.py -c configs/mot/deepsort/reid/deepsort_pcb_pyramid_r101.yml --det_results_dir det_results_dir加载det_results评估报错:
W1211 16:45:02.119659 12084 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.5, Runtime API Version: 11.7
W1211 16:45:02.123663 12084 gpu_resources.cc:91] device: 0, cuDNN Version: 8.4.
[12/11 16:45:02] ppdet.data.source.category WARNING: anno_file 'None' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categories will be used by metric_type.
[12/11 16:45:02] ppdet.data.source.category WARNING: metric_type: MOT, load default categories of pedestrian MOT.
[12/11 16:45:02] ppdet.utils.checkpoint INFO: Finish resuming model weights: C:\Users\whkedx2023/.cache/paddle/weights\deepsort_pplcnet.pdparams
[12/11 16:45:02] ppdet.engine.tracker INFO: Evaluate seq: MOT16-02
[12/11 16:45:02] ppdet.engine.tracker INFO: Found 600 inference images in total.
[12/11 16:45:03] ppdet.engine.tracker INFO: Finish loading detection results file dataset/mot/det_results_dir\MOT16-02.txt.
0%|▎ | 1/600 [00:02<23:52, 2.39s/it]
Traceback (most recent call last):
File "tools/eval_mot.py", line 144, in
main()
File "tools/eval_mot.py", line 140, in main
run(FLAGS, cfg)
File "tools/eval_mot.py", line 99, in run
det_results_dir=FLAGS.det_results_dir)
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\engine\tracker.py", line 548, in mot_evaluate
'{}.txt'.format(seq)))
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\engine\tracker.py", line 379, in _eval_seq_sde
online_targets = tracker.update(pred_dets, pred_embs)
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\modeling\mot\tracker\deepsort_tracker.py", line 121, in update
File "ppdet\modeling\mot\motion\kalman_filter.py", line 29:
def nb_project(mean, covariance, std, _update_mat):

mean = np.dot(_update_mat, mean)
covariance = np.dot(np.dot(_update_mat, covariance), _update_mat.T)
^

复现环境 Environment

Windows,PaddleDetection: release/2.6, python: 3.8

Bug描述确认 Bug description confirmation

  • 我确认已经提供了Bug复现步骤、代码改动说明、以及环境信息,确认问题是可以复现的。I confirm that the bug replication steps, code change instructions, and environment information have been provided, and the problem can be reproduced.

是否愿意提交PR? Are you willing to submit a PR?

  • 我愿意提交PR!I'd like to help by submitting a PR!
@Bobholamovic
Copy link
Member

请问方便贴一下完整的信息嘛?看起来似乎缺少了最后一段

@ilovefanjian
Copy link
Author

paddle
完整信息

@Bobholamovic
Copy link
Member

Bobholamovic commented Dec 12, 2024

看起来可能是一个数据类型问题,建议尝试修改代码,将报错位置改成:

covariance = np.dot(np.dot(_update_mat.astype(np.float32), covariance.astype(np.float32)), _update_mat.T.astype(np.float32))

@ilovefanjian
Copy link
Author

又出现了新的错误
(PaddleDetection) D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6>python tools/eval_mot.py -c configs/mot/deepsort/reid/deepsort_pcb_pyramid_r101.yml --det_results_dir dataset/mot/det_results_dir
W1212 16:36:55.255107 728 gpu_resources.cc:61] Please NOTE: device: 0, GPU Compute Capability: 8.6, Driver API Version: 12.5, Runtime API Version: 11.7
W1212 16:36:55.258111 728 gpu_resources.cc:91] device: 0, cuDNN Version: 8.4.
[12/12 16:36:55] ppdet.data.source.category WARNING: anno_file 'None' is None or not set or not exist, please recheck TrainDataset/EvalDataset/TestDataset.anno_path, otherwise the default categories will be used by metric_type.
[12/12 16:36:55] ppdet.data.source.category WARNING: metric_type: MOT, load default categories of pedestrian MOT.
[12/12 16:36:56] ppdet.utils.checkpoint INFO: Finish resuming model weights: mot_det_weight/deepsort_pcb_pyramid_r101.pdparams
[12/12 16:36:56] ppdet.engine.tracker INFO: Evaluate seq: MOT16-02
[12/12 16:36:56] ppdet.engine.tracker INFO: Found 600 inference images in total.
[12/12 16:36:57] ppdet.engine.tracker INFO: Finish loading detection results file dataset/mot/det_results_dir\MOT16-02.txt.
0%|▎ | 1/600 [00:03<33:53, 3.40s/it]
Traceback (most recent call last):
File "tools/eval_mot.py", line 144, in
main()
File "tools/eval_mot.py", line 140, in main
run(FLAGS, cfg)
File "tools/eval_mot.py", line 99, in run
det_results_dir=FLAGS.det_results_dir)
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\engine\tracker.py", line 548, in mot_evaluate
'{}.txt'.format(seq)))
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\engine\tracker.py", line 379, in _eval_seq_sde
online_targets = tracker.update(pred_dets, pred_embs)
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\modeling\mot\tracker\deepsort_tracker.py", line 121, in update
detections[detection_idx])
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\modeling\mot\tracker\base_sde_tracker.py", line 127, in update
detection.to_xyah())
File "D:\DeepLearning\two\hzhlearning\PaddleDetection-release-2.6\ppdet\modeling\mot\motion\kalman_filter.py", line 262, in update
measurement, self._update_mat)
File "D:\DeepLearning\Anaconda3\envs\PaddleDetection\lib\site-packages\numba\core\dispatcher.py", line 468, in _compile_for_args
error_rewrite(e, 'typing')
File "D:\DeepLearning\Anaconda3\envs\PaddleDetection\lib\site-packages\numba\core\dispatcher.py", line 409, in error_rewrite
raise e.with_traceback(None)

File "ppdet\modeling\mot\motion\kalman_filter.py", line 43:
def nb_update(mean, covariance, proj_mean, proj_cov, measurement, meas_mat):
kalman_gain = np.linalg.solve(proj_cov, (covariance @meas_mat.T).T).T

@Bobholamovic
Copy link
Member

错误信息似乎不完整……如果还是类似的报错的话,可以采用类似的改写方法,即添加.astype(np.float32)

@ilovefanjian
Copy link
Author

谢谢,问题已经解决,请问bytetrack和其他算法,如何通过加载检测框结果det_results_dir的方式在自制数据集上进行跟踪评估。

@Sunting78
Copy link
Collaborator

Sunting78 commented Dec 13, 2024

您好 use_detector设置为False 并且传入det_file 相关接口:

def _eval_seq_sde(self,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants