Multi Object Trackers基于 Python 的多對象跟蹤器
Multi Object Trackers 是一個基于 Python,易于使用的各種多對象跟蹤算法的實現(xiàn)。
可用的多對象跟蹤器
CentroidTracker
IOUTracker
CentroidKF_Tracker
SORT
可用的基于 OpenCV 的物體檢測器:
detector.TF_SSDMobileNetV2
detector.Caffe_SSDMobileNet
detector.YOLOv3
安裝
OpenCV(版本 3.4.3 或更高版本)的 Pip install 可以使用以下命令完成:
git clone https://github.com/adipandas/multi-object-tracker
cd multi-object-tracker
pip install -r requirements.txt
pip install -e .
如何使用?
每個跟蹤器的界面都很簡單而相似,可參考下面的示例模板:
from motrackers import CentroidTracker # or IOUTracker, CentroidKF_Tracker, SORT
input_data = ...
detector = ...
tracker = CentroidTracker(...) # or IOUTracker(...), CentroidKF_Tracker(...), SORT(...)
while True:
done, image =
if done:
break
detection_bboxes, detection_confidences, detection_class_ids = detector.detect(image)
# NOTE:
# * `detection_bboxes` are numpy.ndarray of shape (n, 4) with each row containing (bb_left, bb_top, bb_width, bb_height)
# * `detection_confidences` are numpy.ndarray of shape (n,);
# * `detection_class_ids` are numpy.ndarray of shape (n,).
output_tracks = tracker.update(detection_bboxes, detection_confidences, detection_class_ids)
# `output_tracks` is a list with each element containing tuple of
# (,
,
,
,
,
,
,
,
,
) for track in output_tracks: frame, id, bb_left, bb_top, bb_width, bb_height, confidence, x, y, z = track assert len(track) == 10 print(track)
(input_data)>
(input_data)>有關(guān)更多詳細(xì)信息,請參閱此存儲庫的示例文件夾。您可以克隆和運行示例。
評論
圖片
表情
