From 3a2f741934e9435fec562ad8b081516279988b85 Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Thu, 8 Oct 2026 14:51:32 -0500 Subject: [PATCH] fix untrained classification models not saving images The mypy cleanup in https://github.com/blakeblackshear/frigate/pull/22658 added a check on the tensor details to the top of process_frame for both state and object models. Those are unset until a model is trained, so untrained models returned early and never saved images to Recent Classifications. Remove the check from process_frame, the classify methods already check the tensor details before using them. --- .../real_time/custom_classification.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/frigate/data_processing/real_time/custom_classification.py b/frigate/data_processing/real_time/custom_classification.py index e3b0e23ed8..9ccb7f3233 100644 --- a/frigate/data_processing/real_time/custom_classification.py +++ b/frigate/data_processing/real_time/custom_classification.py @@ -170,12 +170,7 @@ class CustomStateClassificationProcessor(DeferredRealtimeProcessorApi): return None def process_frame(self, frame_data: dict[str, Any], frame: np.ndarray) -> None: - if ( - not self.model_config.name - or not self.model_config.state_config - or not self.tensor_input_details - or not self.tensor_output_details - ): + if not self.model_config.name or not self.model_config.state_config: return if self.metrics and self.model_config.name in self.metrics.classification_cps: @@ -515,12 +510,7 @@ class CustomObjectClassificationProcessor(DeferredRealtimeProcessorApi): return best_label, avg_score def process_frame(self, obj_data: dict[str, Any], frame: np.ndarray) -> None: - if ( - not self.model_config.name - or not self.model_config.object_config - or not self.tensor_input_details - or not self.tensor_output_details - ): + if not self.model_config.name or not self.model_config.object_config: return if self.metrics and self.model_config.name in self.metrics.classification_cps: