Debug frame cache (#18697)

This commit is contained in:
Josh Hawkins 2025-06-12 14:39:06 -05:00 committed by GitHub
parent 4a21b2f16d
commit 25cc2f31d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View File

@ -256,6 +256,7 @@ class CameraState:
updated_ids = current_ids.intersection(previous_ids)
for id in new_ids:
logger.debug(f"{self.name}: New tracked object ID: {id}")
new_obj = tracked_objects[id] = TrackedObject(
self.config.model,
self.camera_config,
@ -265,6 +266,7 @@ 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)
# save initial thumbnail data and best object
@ -429,6 +431,9 @@ 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']}"
)
del self.frame_cache[t]
with self.current_frame_lock:

View File

@ -350,6 +350,9 @@ class TrackedObject:
self.obj_data.update(obj_data)
self.current_zones = current_zones
logger.debug(
f"{self.camera_config.name}: Updating {obj_data['id']}: thumb update? {thumb_update}, significant change? {significant_change}, path update? {path_update}, autotracker update? {autotracker_update} "
)
return (thumb_update, significant_change, path_update, autotracker_update)
def to_dict(self):