mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-07-30 13:48:07 +02:00
Improve frame cache debugging (#18741)
This commit is contained in:
parent
2d586eeeb7
commit
d727adddde
@ -266,8 +266,13 @@ class CameraState:
|
||||
)
|
||||
|
||||
# add initial frame to frame cache
|
||||
logger.debug(f"{self.name}: Adding {frame_time} to frame cache for {id}")
|
||||
self.frame_cache[frame_time] = np.copy(current_frame)
|
||||
logger.debug(
|
||||
f"{self.name}: New object, adding {frame_time} to frame cache for {id}"
|
||||
)
|
||||
self.frame_cache[frame_time] = {
|
||||
"frame": np.copy(current_frame),
|
||||
"object_id": id,
|
||||
}
|
||||
|
||||
# save initial thumbnail data and best object
|
||||
thumbnail_data = {
|
||||
@ -313,7 +318,13 @@ class CameraState:
|
||||
updated_obj.thumbnail_data["frame_time"] == frame_time
|
||||
and frame_time not in self.frame_cache
|
||||
):
|
||||
self.frame_cache[frame_time] = np.copy(current_frame)
|
||||
logger.debug(
|
||||
f"{self.name}: Existing object, adding {frame_time} to frame cache for {id}"
|
||||
)
|
||||
self.frame_cache[frame_time] = {
|
||||
"frame": np.copy(current_frame),
|
||||
"object_id": id,
|
||||
}
|
||||
|
||||
updated_obj.last_updated = frame_time
|
||||
|
||||
@ -431,9 +442,8 @@ class CameraState:
|
||||
if t not in current_thumb_frames and t not in current_best_frames
|
||||
]
|
||||
for t in thumb_frames_to_delete:
|
||||
logger.debug(
|
||||
f"{self.name}: Deleting {t} from frame cache for {obj.obj_data['id']}"
|
||||
)
|
||||
object_id = self.frame_cache[t].get("object_id", "unknown")
|
||||
logger.debug(f"{self.name}: Deleting {t} from frame cache for {object_id}")
|
||||
del self.frame_cache[t]
|
||||
|
||||
with self.current_frame_lock:
|
||||
|
@ -419,7 +419,7 @@ class TrackedObject:
|
||||
|
||||
try:
|
||||
best_frame = cv2.cvtColor(
|
||||
self.frame_cache[self.thumbnail_data["frame_time"]],
|
||||
self.frame_cache[self.thumbnail_data["frame_time"]]["frame"],
|
||||
cv2.COLOR_YUV2BGR_I420,
|
||||
)
|
||||
except KeyError:
|
||||
@ -448,7 +448,7 @@ class TrackedObject:
|
||||
|
||||
try:
|
||||
best_frame = cv2.cvtColor(
|
||||
self.frame_cache[self.thumbnail_data["frame_time"]],
|
||||
self.frame_cache[self.thumbnail_data["frame_time"]]["frame"],
|
||||
cv2.COLOR_YUV2BGR_I420,
|
||||
)
|
||||
except KeyError:
|
||||
|
Loading…
Reference in New Issue
Block a user