NVR with realtime local object detection for IP cameras
TypeScript aicameragoogle-coralhome-assistanthome-automationhomeautomationmqttnvrobject-detectionrealtimertsptensorflow
Frame time fix (#17816)
Josh Hawkins6936d3317243
diff --git a/frigate/track/tracked_object.py b/frigate/track/tracked_object.pyindex f5511b7bc1..9690581f1f 100644--- a/frigate/track/tracked_object.py+++ b/frigate/track/tracked_object.py@@ -138,45 +138,35 @@ class TrackedObject:if not self.false_positive and has_valid_frame:# determine if this frame is a better thumbnail- if self.thumbnail_data is None or (- better_thumb := is_better_thumbnail(- self.obj_data["label"],- self.thumbnail_data,- obj_data,- self.camera_config.frame_shape,- )+ if self.thumbnail_data is None or is_better_thumbnail(+ self.obj_data["label"],+ self.thumbnail_data,+ obj_data,+ self.camera_config.frame_shape,):- # use the current frame time if the object's frame time isn't in the frame cache- selected_frame_time = (- current_frame_time- if obj_data["frame_time"] not in self.frame_cache.keys()- else obj_data["frame_time"]- )- if (- obj_data["frame_time"] not in self.frame_cache.keys()- and not better_thumb- ):- logger.warning(- f"Frame time {obj_data['frame_time']} not in frame cache, using current frame time {selected_frame_time}"+ if obj_data["frame_time"] == current_frame_time:+ self.thumbnail_data = {+ "frame_time": obj_data["frame_time"],+ "box": obj_data["box"],+ "area": obj_data["area"],+ "region": obj_data["region"],+ "score": obj_data["score"],+ "attributes": obj_data["attributes"],+ "current_estimated_speed": self.current_estimated_speed,+ "velocity_angle": self.velocity_angle,+ "path_data": self.path_data,+ "recognized_license_plate": obj_data.get(+ "recognized_license_plate"+ ),+ "recognized_license_plate_score": obj_data.get(+ "recognized_license_plate_score"+ ),+ }+ thumb_update = True+ else:+ logger.debug(+ f"{self.camera_config.name}: Object frame time {obj_data['frame_time']} is not equal to the current frame time {current_frame_time}, not updating thumbnail")- self.thumbnail_data = {- "frame_time": selected_frame_time,- "box": obj_data["box"],- "area": obj_data["area"],- "region": obj_data["region"],- "score": obj_data["score"],- "attributes": obj_data["attributes"],- "current_estimated_speed": self.current_estimated_speed,- "velocity_angle": self.velocity_angle,- "path_data": self.path_data,- "recognized_license_plate": obj_data.get(- "recognized_license_plate"- ),- "recognized_license_plate_score": obj_data.get(- "recognized_license_plate_score"- ),- }- thumb_update = True# check zonescurrent_zones = []