From 60212a9aa4e5dd7021c42e9de7db3f243603acfa Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 23 May 2025 06:09:43 -0600 Subject: [PATCH] Correctly check for objects --- frigate/data_processing/real_time/teachable_machine.py | 2 +- frigate/embeddings/maintainer.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/frigate/data_processing/real_time/teachable_machine.py b/frigate/data_processing/real_time/teachable_machine.py index bf5b2d30f..31bb60c6d 100644 --- a/frigate/data_processing/real_time/teachable_machine.py +++ b/frigate/data_processing/real_time/teachable_machine.py @@ -127,7 +127,7 @@ class TeachableMachineObjectProcessor(RealTimeProcessorApi): self.labelmap = load_labels(self.model_config.labelmap_path, prefill=0) def process_frame(self, obj_data, frame): - if obj_data["label"] != "object": + if obj_data["label"] not in self.model_config.object_config.objects: return x, y, x2, y2 = calculate_region( diff --git a/frigate/embeddings/maintainer.py b/frigate/embeddings/maintainer.py index 8a745117a..c8b1a079f 100644 --- a/frigate/embeddings/maintainer.py +++ b/frigate/embeddings/maintainer.py @@ -503,9 +503,7 @@ class EmbeddingMaintainer(threading.Thread): if isinstance(processor, LicensePlateRealTimeProcessor): processor.process_frame(camera, yuv_frame, True) - if isinstance(processor, TeachableMachineObjectProcessor) or isinstance( - processor, TeachableMachineStateProcessor - ): + if isinstance(processor, TeachableMachineStateProcessor): processor.process_frame({"camera": camera}, yuv_frame) self.frame_manager.close(frame_name)