mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 10:45:21 +03:00
use estimated boxes for regions
This commit is contained in:
parent
a4117297e2
commit
af3d964e9c
@ -231,16 +231,21 @@ class NorfairTracker(ObjectTracker):
|
||||
# update or create new tracks
|
||||
active_ids = []
|
||||
for t in tracked_objects:
|
||||
obj = {
|
||||
**t.last_detection.data,
|
||||
"estimate": tuple(t.estimate.flatten().astype(int)),
|
||||
}
|
||||
active_ids.append(t.global_id)
|
||||
if t.global_id not in self.track_id_map:
|
||||
self.register(t.global_id, t.last_detection.data)
|
||||
self.register(t.global_id, obj)
|
||||
# if there wasn't a detection in this frame, increment disappeared
|
||||
elif t.last_detection.data["frame_time"] != frame_time:
|
||||
id = self.track_id_map[t.global_id]
|
||||
self.disappeared[id] += 1
|
||||
self.tracked_objects[id]["estimate"] = obj["estimate"]
|
||||
# else update it
|
||||
else:
|
||||
self.update(t.global_id, t.last_detection.data)
|
||||
self.update(t.global_id, obj)
|
||||
|
||||
# clear expired tracks
|
||||
expired_ids = [k for k in self.track_id_map.keys() if k not in active_ids]
|
||||
|
||||
@ -656,7 +656,7 @@ def process_frames(
|
||||
|
||||
# get tracked object boxes that aren't stationary
|
||||
tracked_object_boxes = [
|
||||
obj["box"]
|
||||
obj["estimate"]
|
||||
for obj in object_tracker.tracked_objects.values()
|
||||
if obj["id"] not in stationary_object_ids
|
||||
]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user