fixes to get frame names working

This commit is contained in:
Nicolas Mowen 2024-07-08 10:16:51 -06:00
parent 6588153a7e
commit 5d892e1112
4 changed files with 9 additions and 4 deletions

View File

@ -63,7 +63,9 @@ class PtzMotionEstimator:
self.ptz_metrics["ptz_reset"].set() self.ptz_metrics["ptz_reset"].set()
logger.debug(f"{config.name}: Motion estimator init") logger.debug(f"{config.name}: Motion estimator init")
def motion_estimator(self, detections, frame_name, frame_time, camera): def motion_estimator(
self, detections, frame_name: str, frame_time: int, camera: str
):
# If we've just started up or returned to our preset, reset motion estimator for new tracking session # If we've just started up or returned to our preset, reset motion estimator for new tracking session
if self.ptz_metrics["ptz_reset"].is_set(): if self.ptz_metrics["ptz_reset"].is_set():
self.ptz_metrics["ptz_reset"].clear() self.ptz_metrics["ptz_reset"].clear()

View File

@ -480,6 +480,7 @@ class RecordingMaintainer(threading.Thread):
if topic == DetectionTypeEnum.video: if topic == DetectionTypeEnum.video:
( (
camera, camera,
_,
frame_time, frame_time,
current_tracked_objects, current_tracked_objects,
motion_boxes, motion_boxes,

View File

@ -285,7 +285,9 @@ class NorfairTracker(ObjectTracker):
] ]
self.match_and_update(frame_name, frame_time, detections=detections) self.match_and_update(frame_name, frame_time, detections=detections)
def match_and_update(self, frame_name, frame_time, detections): def match_and_update(
self, frame_name: str, frame_time: float, detections: list[tuple]
):
norfair_detections = [] norfair_detections = []
for obj in detections: for obj in detections:

View File

@ -591,7 +591,7 @@ def process_frames(
# if detection is disabled # if detection is disabled
if not detect_config.enabled: if not detect_config.enabled:
object_tracker.match_and_update(frame_time, []) object_tracker.match_and_update(frame_name, frame_time, [])
else: else:
# get stationary object ids # get stationary object ids
# check every Nth frame for stationary objects # check every Nth frame for stationary objects
@ -715,7 +715,7 @@ def process_frames(
if d[0] not in ALL_ATTRIBUTE_LABELS if d[0] not in ALL_ATTRIBUTE_LABELS
] ]
# now that we have refined our detections, we need to track objects # now that we have refined our detections, we need to track objects
object_tracker.match_and_update(frame_time, tracked_detections) object_tracker.match_and_update(frame_name, frame_time, tracked_detections)
# else, just update the frame times for the stationary objects # else, just update the frame times for the stationary objects
else: else:
object_tracker.update_frame_times(frame_name, frame_time) object_tracker.update_frame_times(frame_name, frame_time)