From 08f0306fd092be72a81ed6def67e3fdeb9d8bb16 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 17 Dec 2025 15:19:26 -0700 Subject: [PATCH] Catch case of non-trained model that doesn't add infinite number of classification images --- frigate/data_processing/real_time/custom_classification.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frigate/data_processing/real_time/custom_classification.py b/frigate/data_processing/real_time/custom_classification.py index 2dae9f0b7..ee72e145c 100644 --- a/frigate/data_processing/real_time/custom_classification.py +++ b/frigate/data_processing/real_time/custom_classification.py @@ -519,6 +519,13 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi): 0.0, max_files=save_attempts, ) + + # Still track history even when model doesn't exist to respect MAX_OBJECT_CLASSIFICATIONS + # Add an entry with "unknown" label so the history limit is enforced + if object_id not in self.classification_history: + self.classification_history[object_id] = [] + + self.classification_history[object_id].append(("unknown", 0.0, now)) return input = np.expand_dims(resized_crop, axis=0)