Stationary bug fixes (#20225)

* Correctly only enable for car

* Fix limiting stationary objects history
This commit is contained in:
Nicolas Mowen 2025-09-26 06:03:59 -06:00 committed by GitHub
parent 8b293449f9
commit 082867447b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -410,7 +410,7 @@ class NorfairTracker(ObjectTracker):
# if there are more than 5 and less than 10 entries for the position, add the bounding box # if there are more than 5 and less than 10 entries for the position, add the bounding box
# and recompute the position box # and recompute the position box
if 5 <= len(position["xmins"]) < 10: if len(position["xmins"]) < 10:
position["xmins"].append(xmin) position["xmins"].append(xmin)
position["ymins"].append(ymin) position["ymins"].append(ymin)
position["xmaxs"].append(xmax) position["xmaxs"].append(xmax)
@ -614,7 +614,11 @@ class NorfairTracker(ObjectTracker):
self.tracked_objects[id]["estimate"] = new_obj["estimate"] self.tracked_objects[id]["estimate"] = new_obj["estimate"]
# else update it # else update it
else: else:
self.update(str(t.global_id), new_obj, yuv_frame) self.update(
str(t.global_id),
new_obj,
yuv_frame if new_obj["label"] == "car" else None,
)
# clear expired tracks # clear expired tracks
expired_ids = [k for k in self.track_id_map.keys() if k not in active_ids] expired_ids = [k for k in self.track_id_map.keys() if k not in active_ids]