【问题标题】:Faster R-CNN object detection and deep-sort tracking algorithm integration更快的 R-CNN 对象检测和深度排序跟踪算法集成
【发布时间】:2020-11-07 11:24:09
【问题描述】:

我一直在尝试将 Faster R-CNN 对象检测模型与深度排序跟踪算法相结合。但是,由于某种原因,跟踪算法表现不佳,这意味着同一个人的跟踪 ID 只会不断增加。

我已使用此存储库来构建我自己的脚本。 (查看 demo.py)deep-sort yolov3

我做了什么:

  1. 每 30 帧检测一次

  2. 为检测分数创建了一个列表

  3. 为检测边界框创建了一个列表(考虑深度排序的输入格式)

  4. 调用跟踪器!!!

                 # tracking and draw bounding boxes
             for i in range(0, len(refine_person_detection)):
    
                 confidence_worker.append(refine_person_detection[i][4]) # scores
                 bboxes.append([refine_person_detection[i][0], refine_person_detection[i][2],
                                (refine_person_detection[i][1] - refine_person_detection[i][0]),
                                (refine_person_detection[i][3] - refine_person_detection[i][2])]) # bounding boxes
    
                 features = encoder(frame, bboxes)
    
                 detections = [Detection(bbox, confidence, feature) for bbox, confidence, feature in
                               zip(bboxes, confidence_worker, features)]
    
                 boxes = np.array([d.tlwh for d in detections])
                 scores = np.array([d.confidence for d in detections])
                 indices = preprocessing.non_max_suppression(boxes, nms_max_overlap, scores)
                 detections = [detections[i] for i in indices]
    
                 tracker.predict() # calling the tracker
                 tracker.update(detections)
    
                 for track in tracker.tracks:
                     k.append(track)
                     if not track.is_confirmed() or track.time_since_update > 1:
                         continue
                     bbox = track.to_tlbr()
                     cv2.rectangle(frame, (int(bbox[0]), int(bbox[1])), (int(bbox[2]), int(bbox[3])),
                                   (255, 255, 255), 2)
                     cv2.putText(frame, str(track.track_id), (int(bbox[0]), int(bbox[1])), 0, 5e-3 * 200,
                                 (0, 255, 0), 2)
    

以下是跟踪 ID 增加的不良结果示例。

提前感谢您的任何建议

【问题讨论】:

    标签: tracking object-detection-api faster-rcnn


    【解决方案1】:

    我也研究同样的东西,我也尝试将它们结合起来。你做了,有什么进展吗?

    【讨论】:

    • 请找到以上答案考虑
    【解决方案2】:

    提供的代码是正确的。 但是,必须每帧都进行检测。 由于深度排序使用边界框内的特征进行跟踪,因此检测框之间存在间隙会导致同一个人数量增加的问题

    附注: @Mustafa 请在每个帧检测中检查上面的代码,应该可以工作。 如果没有,请随时发表评论

    【讨论】:

      猜你喜欢
      • 2019-07-17
      • 2020-08-23
      • 2021-04-27
      • 1970-01-01
      • 1970-01-01
      • 2017-11-25
      • 2019-12-28
      • 1970-01-01
      • 2013-03-17
      相关资源
      最近更新 更多