From fe45130308694d70b9f0d214edb6b9da49603b33 Mon Sep 17 00:00:00 2001 From: Leonardo Merza Date: Sun, 10 Mar 2024 13:18:22 -0400 Subject: [PATCH] sublabel score --- README.md | 1 + index.py | 6 +++++- requirements.txt | 4 +--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e8de929..90dc4bf 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ frigate: mqtt_username: username mqtt_password: password main_topic: frigate + sublabel_score: true camera: - birdcam bird_classification: diff --git a/index.py b/index.py index bf9be76..5dfa570 100644 --- a/index.py +++ b/index.py @@ -28,7 +28,7 @@ firstmessage = True _LOGGER = None -VERSION = '1.0.4' +VERSION = '1.0.5' CONFIG_PATH = './config/config.yml' DB_PATH = './config/classifier.db' @@ -273,6 +273,10 @@ def on_message(client, userdata, message): _LOGGER.error(f"Unknown label: {after_data['label']}") return + # add score to sublabel + if config['frigate'].get('sublabel_score'): + sublabel = f'{sublabel} ({int(score * 100)}%)' + if result is None: # Insert a new record if it doesn't exist _LOGGER.info("No record yet for this event. Storing.") diff --git a/requirements.txt b/requirements.txt index 2c71dbe..fc0d82a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,4 @@ paho_mqtt==1.6.1 PyYAML==6.0.1 tflite-support==0.4.4 requests==2.31.0 -Pillow==10.0.0 -tf-nightly==2.15.0.dev20230803 -scipy==1.11.1 \ No newline at end of file +Pillow==10.0.0 \ No newline at end of file