Correctly check for objects

This commit is contained in:
Nicolas Mowen 2025-05-23 06:09:43 -06:00
parent e7427b47fb
commit 60212a9aa4
2 changed files with 2 additions and 4 deletions

View File

@ -127,7 +127,7 @@ class TeachableMachineObjectProcessor(RealTimeProcessorApi):
self.labelmap = load_labels(self.model_config.labelmap_path, prefill=0) self.labelmap = load_labels(self.model_config.labelmap_path, prefill=0)
def process_frame(self, obj_data, frame): 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 return
x, y, x2, y2 = calculate_region( x, y, x2, y2 = calculate_region(

View File

@ -503,9 +503,7 @@ class EmbeddingMaintainer(threading.Thread):
if isinstance(processor, LicensePlateRealTimeProcessor): if isinstance(processor, LicensePlateRealTimeProcessor):
processor.process_frame(camera, yuv_frame, True) processor.process_frame(camera, yuv_frame, True)
if isinstance(processor, TeachableMachineObjectProcessor) or isinstance( if isinstance(processor, TeachableMachineStateProcessor):
processor, TeachableMachineStateProcessor
):
processor.process_frame({"camera": camera}, yuv_frame) processor.process_frame({"camera": camera}, yuv_frame)
self.frame_manager.close(frame_name) self.frame_manager.close(frame_name)