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:
continue
xc, yc = tobj.estimate[0]
x_min, y_min = int(round(xc - bbox_width / 2)), int(round(yc - bbox_height / 2))
score = tobj.last_detection.scores[0]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)