Add ability to configure when custom classification models run (#18380)

* Add config to control when classification models are run

* Cleanup
This commit is contained in:
Nicolas Mowen
2025-08-16 10:20:33 -05:00
committed by Blake Blackshear
parent 53ff33135b
commit 723553edb7
3 changed files with 65 additions and 10 deletions
+9 -5
View File
@@ -147,13 +147,15 @@ class EmbeddingMaintainer(threading.Thread):
)
)
for model in self.config.classification.custom.values():
for name, model_config in self.config.classification.custom.items():
self.realtime_processors.append(
CustomStateClassificationProcessor(self.config, model, self.metrics)
if model.state_config != None
CustomStateClassificationProcessor(
self.config, model_config, name, self.requestor, self.metrics
)
if model_config.state_config != None
else CustomObjectClassificationProcessor(
self.config,
model,
model_config,
self.event_metadata_publisher,
self.metrics,
)
@@ -504,7 +506,9 @@ class EmbeddingMaintainer(threading.Thread):
processor.process_frame(camera, yuv_frame, True)
if isinstance(processor, CustomStateClassificationProcessor):
processor.process_frame({"camera": camera}, yuv_frame)
processor.process_frame(
{"camera": camera, "motion": motion_boxes}, yuv_frame
)
self.frame_manager.close(frame_name)