mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Frame time fix (#17816)
* Don't update thumbnail/snapshot if frame is not in the frame cache This follows up on changes originally made in https://github.com/blakeblackshear/frigate/pull/17671 - it is possible that is_better_thumbnail is true but the frame_time for the object is not the same as the current_frame_time. So rather than checking the frame cache, this change will only update the thumbnail_data when the two frame time values are the same. * add camera name to debug log
This commit is contained in:
parent
d5f9153c94
commit
6936d33172
@ -138,45 +138,35 @@ class TrackedObject:
|
|||||||
|
|
||||||
if not self.false_positive and has_valid_frame:
|
if not self.false_positive and has_valid_frame:
|
||||||
# determine if this frame is a better thumbnail
|
# determine if this frame is a better thumbnail
|
||||||
if self.thumbnail_data is None or (
|
if self.thumbnail_data is None or is_better_thumbnail(
|
||||||
better_thumb := is_better_thumbnail(
|
self.obj_data["label"],
|
||||||
self.obj_data["label"],
|
self.thumbnail_data,
|
||||||
self.thumbnail_data,
|
obj_data,
|
||||||
obj_data,
|
self.camera_config.frame_shape,
|
||||||
self.camera_config.frame_shape,
|
|
||||||
)
|
|
||||||
):
|
):
|
||||||
# use the current frame time if the object's frame time isn't in the frame cache
|
if obj_data["frame_time"] == current_frame_time:
|
||||||
selected_frame_time = (
|
self.thumbnail_data = {
|
||||||
current_frame_time
|
"frame_time": obj_data["frame_time"],
|
||||||
if obj_data["frame_time"] not in self.frame_cache.keys()
|
"box": obj_data["box"],
|
||||||
else obj_data["frame_time"]
|
"area": obj_data["area"],
|
||||||
)
|
"region": obj_data["region"],
|
||||||
if (
|
"score": obj_data["score"],
|
||||||
obj_data["frame_time"] not in self.frame_cache.keys()
|
"attributes": obj_data["attributes"],
|
||||||
and not better_thumb
|
"current_estimated_speed": self.current_estimated_speed,
|
||||||
):
|
"velocity_angle": self.velocity_angle,
|
||||||
logger.warning(
|
"path_data": self.path_data,
|
||||||
f"Frame time {obj_data['frame_time']} not in frame cache, using current frame time {selected_frame_time}"
|
"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 zones
|
# check zones
|
||||||
current_zones = []
|
current_zones = []
|
||||||
|
Loading…
Reference in New Issue
Block a user