mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-10-10 08:42:49 +03:00
fix untrained classification models not saving images (#24597)
CI / AMD64 Build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
CI / AMD64 Build (push) Canceled after 0s
CI / ARM Build (push) Canceled after 0s
CI / Jetson Jetpack 6 (push) Canceled after 0s
CI / AMD64 Extra Build (push) Canceled after 0s
CI / ARM Extra Build (push) Canceled after 0s
CI / Synaptics Build (push) Canceled after 0s
CI / Assemble and push default build (push) Canceled after 0s
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.
This commit is contained in:
@@ -170,12 +170,7 @@ class CustomStateClassificationProcessor(DeferredRealtimeProcessorApi):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def process_frame(self, frame_data: dict[str, Any], frame: np.ndarray) -> None:
|
def process_frame(self, frame_data: dict[str, Any], frame: np.ndarray) -> None:
|
||||||
if (
|
if not self.model_config.name or not self.model_config.state_config:
|
||||||
not self.model_config.name
|
|
||||||
or not self.model_config.state_config
|
|
||||||
or not self.tensor_input_details
|
|
||||||
or not self.tensor_output_details
|
|
||||||
):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.metrics and self.model_config.name in self.metrics.classification_cps:
|
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
|
return best_label, avg_score
|
||||||
|
|
||||||
def process_frame(self, obj_data: dict[str, Any], frame: np.ndarray) -> None:
|
def process_frame(self, obj_data: dict[str, Any], frame: np.ndarray) -> None:
|
||||||
if (
|
if not self.model_config.name or not self.model_config.object_config:
|
||||||
not self.model_config.name
|
|
||||||
or not self.model_config.object_config
|
|
||||||
or not self.tensor_input_details
|
|
||||||
or not self.tensor_output_details
|
|
||||||
):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.metrics and self.model_config.name in self.metrics.classification_cps:
|
if self.metrics and self.model_config.name in self.metrics.classification_cps:
|
||||||
|
|||||||
Reference in New Issue
Block a user