PaddleDetection icon indicating copy to clipboard operation
PaddleDetection copied to clipboard

MTMCT 跨境头追踪: 为啥教程中的demo视频可以预测,换成自己的视频就预测失败呢

Open wjq842121846 opened this issue 4 years ago • 6 comments

问题确认 Search before asking

  • [X] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

Tracking frame: 2700 Tracking frame: 2710 Tracking frame: 2720 Tracking frame: 2730 [WARNNING] No object detected. Traceback (most recent call last): File "deploy/pptracking/python/mot_sde_infer.py", line 850, in main() File "deploy/pptracking/python/mot_sde_infer.py", line 819, in main detector.predict_mtmct(FLAGS.mtmct_dir, mtmct_cfg) File "deploy/pptracking/python/mot_sde_infer.py", line 730, in predict_mtmct mot_features_dict = self.predict_image( File "deploy/pptracking/python/mot_sde_infer.py", line 489, in predict_image tracking_outs = self.tracking(det_result) File "deploy/pptracking/python/mot_sde_infer.py", line 288, in tracking online_targets = self.tracker.update(pred_dets, pred_embs) File "/mnt/PaddleDetection/deploy/pptracking/python/mot/tracker/deepsort_tracker.py", line 104, in update for tlwh, score, feat, cls_id in zip(pred_tlwhs, pred_scores, TypeError: 'NoneType' object is not iterable

wjq842121846 avatar Sep 07 '22 06:09 wjq842121846

数据集差别大,模型检测效果低,需要用你数据集场景的数据重训下检测器的。

nemonameless avatar Sep 09 '22 05:09 nemonameless

楼主在替换成自己的视频的时候都修改了哪些参数呀

Hyperjunct avatar Sep 29 '22 06:09 Hyperjunct

问题确认 Search before asking

  • [x] 我已经搜索过问题,但是没有找到解答。I have searched the question and found no related answer.

请提出你的问题 Please ask your question

Tracking frame: 2700 Tracking frame: 2710 Tracking frame: 2720 Tracking frame: 2730 [WARNNING] No object detected. Traceback (most recent call last): File "deploy/pptracking/python/mot_sde_infer.py", line 850, in main() File "deploy/pptracking/python/mot_sde_infer.py", line 819, in main detector.predict_mtmct(FLAGS.mtmct_dir, mtmct_cfg) File "deploy/pptracking/python/mot_sde_infer.py", line 730, in predict_mtmct mot_features_dict = self.predict_image( File "deploy/pptracking/python/mot_sde_infer.py", line 489, in predict_image tracking_outs = self.tracking(det_result) File "deploy/pptracking/python/mot_sde_infer.py", line 288, in tracking online_targets = self.tracker.update(pred_dets, pred_embs) File "/mnt/PaddleDetection/deploy/pptracking/python/mot/tracker/deepsort_tracker.py", line 104, in update for tlwh, score, feat, cls_id in zip(pred_tlwhs, pred_scores, TypeError: 'NoneType' object is not iterable

我今天尝试将demo中的视频替换为自己的视频,也遇到了相同的问题,楼主目前有解决吗 微信截图_20220929194949

Hyperjunct avatar Sep 29 '22 11:09 Hyperjunct

@Hyperjunct 你这个错误看起来是某一帧没有检测到目标,程序内部没有做好防护导致的;我也遇到了相同的问题,暂时还没有解决

lazylazypig avatar Oct 10 '22 07:10 lazylazypig

@wjq842121846 @Hyperjunct 修改文件PaddleDetection\deploy\pptracking\python\mot_sde_infer.py中的SDE_Detector.reidprocess(...)函数,大约254行,改为:

        if len(keep_idx[0]) == 0:
            # det_results['boxes'] = np.zeros((1, 6), dtype=np.float32)
            # det_results['embeddings'] = None
            det_results['boxes'] = np.zeros((0, 6), dtype=np.float32) #返回一个空的数组
            det_results['embeddings'] = np.full((0, 0), None)  #返回一个空的数组
            return det_results

我测试了一个9000多帧的交通类视频,有很多帧是没有目标或者检测不到目标的,能够正常跑完。

1665405586366

PS:我使用的版本号是最新的2.5

lazylazypig avatar Oct 10 '22 12:10 lazylazypig

@wjq842121846 @Hyperjunct 修改文件PaddleDetection\deploy\pptracking\python\mot_sde_infer.py中的SDE_Detector.reidprocess(...)函数,大约254行,改为:

        if len(keep_idx[0]) == 0:
            # det_results['boxes'] = np.zeros((1, 6), dtype=np.float32)
            # det_results['embeddings'] = None
            det_results['boxes'] = np.zeros((0, 6), dtype=np.float32) #返回一个空的数组
            det_results['embeddings'] = np.full((0, 0), None)  #返回一个空的数组
            return det_results

我测试了一个9000多帧的交通类视频,有很多帧是没有目标或者检测不到目标的,能够正常跑完。

1665405586366

PS:我使用的版本号是最新的2.5

您提供的修改方法十分有效,我已经在自己录制的视频上实现了跨境跟踪的效果,感谢您的回答!

Hyperjunct avatar Nov 03 '22 07:11 Hyperjunct