mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-05 18:55:23 +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
|
# update or create new tracks
|
||||||
active_ids = []
|
active_ids = []
|
||||||
for t in tracked_objects:
|
for t in tracked_objects:
|
||||||
|
obj = {
|
||||||
|
**t.last_detection.data,
|
||||||
|
"estimate": tuple(t.estimate.flatten().astype(int)),
|
||||||
|
}
|
||||||
active_ids.append(t.global_id)
|
active_ids.append(t.global_id)
|
||||||
if t.global_id not in self.track_id_map:
|
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
|
# if there wasn't a detection in this frame, increment disappeared
|
||||||
elif t.last_detection.data["frame_time"] != frame_time:
|
elif t.last_detection.data["frame_time"] != frame_time:
|
||||||
id = self.track_id_map[t.global_id]
|
id = self.track_id_map[t.global_id]
|
||||||
self.disappeared[id] += 1
|
self.disappeared[id] += 1
|
||||||
|
self.tracked_objects[id]["estimate"] = obj["estimate"]
|
||||||
# else update it
|
# else update it
|
||||||
else:
|
else:
|
||||||
self.update(t.global_id, t.last_detection.data)
|
self.update(t.global_id, obj)
|
||||||
|
|
||||||
# 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]
|
||||||
|
|||||||
@ -656,7 +656,7 @@ def process_frames(
|
|||||||
|
|
||||||
# get tracked object boxes that aren't stationary
|
# get tracked object boxes that aren't stationary
|
||||||
tracked_object_boxes = [
|
tracked_object_boxes = [
|
||||||
obj["box"]
|
obj["estimate"]
|
||||||
for obj in object_tracker.tracked_objects.values()
|
for obj in object_tracker.tracked_objects.values()
|
||||||
if obj["id"] not in stationary_object_ids
|
if obj["id"] not in stationary_object_ids
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user