This commit is contained in:
Nicolas Mowen 2025-06-26 18:52:13 -06:00
parent 93fd0fa775
commit 88924d4466

View File

@ -150,10 +150,7 @@ class CustomStateClassificationProcessor(RealTimeProcessorApi):
score, score,
) )
if score >= camera_config.threshold : if score >= camera_config.threshold:
sub_label = self.labelmap[best_id]
if sub_label.lower() != "none":
self.requestor.send_data( self.requestor.send_data(
f"{camera}/classification/{self.model_config.name}", f"{camera}/classification/{self.model_config.name}",
self.labelmap[best_id], self.labelmap[best_id],
@ -275,11 +272,14 @@ class CustomObjectClassificationProcessor(RealTimeProcessorApi):
logger.debug(f"Score {score} is worse than previous score {previous_score}") logger.debug(f"Score {score} is worse than previous score {previous_score}")
return return
sub_label = self.labelmap[best_id]
self.detected_objects[obj_data["id"]] = score
if sub_label != "none":
self.sub_label_publisher.publish( self.sub_label_publisher.publish(
EventMetadataTypeEnum.sub_label, EventMetadataTypeEnum.sub_label,
(obj_data["id"], self.labelmap[best_id], score), (obj_data["id"], sub_label, score),
) )
self.detected_objects[obj_data["id"]] = score
def handle_request(self, topic, request_data): def handle_request(self, topic, request_data):
if topic == EmbeddingsRequestEnum.reload_classification_model.value: if topic == EmbeddingsRequestEnum.reload_classification_model.value: