fix: fix mypy

This commit is contained in:
ZhaiSoul 2026-04-14 17:49:19 +08:00
parent 36a08a9af5
commit 0c40b4b1ac

View File

@ -430,7 +430,11 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi):
"""Run inference in a separate thread to avoid blocking.""" """Run inference in a separate thread to avoid blocking."""
try: try:
with self.interpreter_lock: with self.interpreter_lock:
if self.interpreter is None: if (
self.interpreter is None
or not self.tensor_input_details
or not self.tensor_output_details
):
return return
input = np.expand_dims(crop, axis=0) input = np.expand_dims(crop, axis=0)
@ -513,6 +517,9 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi):
f"{self.model_config.name}: Publishing sub_label={consensus_label} for object {object_id} on {camera}" f"{self.model_config.name}: Publishing sub_label={consensus_label} for object {object_id} on {camera}"
) )
if not self.model_config.object_config:
return
if ( if (
self.model_config.object_config.classification_type self.model_config.object_config.classification_type
== ObjectClassificationType.sub_label == ObjectClassificationType.sub_label