目标检测之Kalman滤波追踪

github

tracker = Tracker(
    distance_function=euclidean_distance, 
    distance_threshold=49,
    hit_inertia_min=2,
    hit_inertia_max=6,
    initialization_delay=2,
)
for idx, img in enumerate(imgs):
	detects = []
	bboxes, confs  = predict(model, img, size=IMG_SIZE, augment=AUGMENT) #目标检测代码
	for bbox, score in zip(bboxes, confs):
         x1, y1, x2, y2 = bbox
         detects.append([x1, y1, x2, y2, score])
    tracked_objects = tracker.update(detections=to_norfair(detects, idx))
    for tobj in tracked_objects:
        bbox_width, bbox_height, last_detected_frame_id = tobj.last_detection.data
        if last_detected_frame_id == idx:  # Skip objects that were detected on current frame
            continue

        # Add objects that have no detections on current frame to predictions
        xc, yc = tobj.estimate[0]
        x_min, y_min = int(round(xc - bbox_width / 2)), int(round(yc - bbox_height / 2)) #tracking结果
        score = tobj.last_detection.scores[0]

版权声明:本文为CSDN博主「mathlmj」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/mathlxj/article/details/122941492

mathlmj

我还没有学会写个人说明!

暂无评论

发表评论

相关推荐

YOLOX笔记

目录 1. 样本匹配 正负样本划分过程 2. yoloxwarmcos 学习率 3. 无法开启多gpu训练, 或者多gpu训练卡住? 1. 样本匹配 正负样本划分过程 说明: gt_centerbbox是在gt_bbox中心点向四周