mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-03 16:00:29 +01:00
Merge pull request #2100 from alexbelgium/codex/add-use_tphakala_model_v2-option
feat(birdnet-pi): add tphakala model v2 toggle
This commit is contained in:
@@ -61,6 +61,7 @@ Options can be configured through three ways :
|
|||||||
BIRDSONGS_FOLDER: folder to store birdsongs file # It should be an ssd if you want to avoid clogging of analysis
|
BIRDSONGS_FOLDER: folder to store birdsongs file # It should be an ssd if you want to avoid clogging of analysis
|
||||||
MQTT_DISABLED : if true, disables automatic mqtt publishing. Only valid if there is a local broker already available
|
MQTT_DISABLED : if true, disables automatic mqtt publishing. Only valid if there is a local broker already available
|
||||||
LIVESTREAM_BOOT_ENABLED: start livestream from boot, or from settings
|
LIVESTREAM_BOOT_ENABLED: start livestream from boot, or from settings
|
||||||
|
Use_tphakala_model_v2: false # switch to BirdNET-Go classifier files
|
||||||
PROCESSED_FOLDER_ENABLED : if enabled, you need to set in the birdnet.conf (or the setting of birdnet) the number of last wav files that will be saved in the temporary folder "/tmp/Processed" within the tmpfs (so no disk wear) in case you want to retrieve them. This amount can be adapted from the addon options
|
PROCESSED_FOLDER_ENABLED : if enabled, you need to set in the birdnet.conf (or the setting of birdnet) the number of last wav files that will be saved in the temporary folder "/tmp/Processed" within the tmpfs (so no disk wear) in case you want to retrieve them. This amount can be adapted from the addon options
|
||||||
TZ: Etc/UTC specify a timezone to use, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
TZ: Etc/UTC specify a timezone to use, see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
|
||||||
pi_password: set the user password to access the web terminal
|
pi_password: set the user password to access the web terminal
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ Ensure you have the following installed on your system:
|
|||||||
- TZ=Europe/Vienna # Optional: Set your timezone according to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
- TZ=Europe/Vienna # Optional: Set your timezone according to https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
||||||
- BIRDSONGS_FOLDER=/config/BirdSongs # Folder to store bird songs, be sure to use a path that is mapped to a volume (such as /config)
|
- BIRDSONGS_FOLDER=/config/BirdSongs # Folder to store bird songs, be sure to use a path that is mapped to a volume (such as /config)
|
||||||
- LIVESTREAM_BOOT_ENABLED=false # Enable/disable livestream on boot
|
- LIVESTREAM_BOOT_ENABLED=false # Enable/disable livestream on boot
|
||||||
|
- Use_tphakala_model_v2=false # Switch to BirdNET-Go classifier files
|
||||||
- ssl=false # Enable/disable SSL
|
- ssl=false # Enable/disable SSL
|
||||||
- certfile=fullchain.pem # SSL certificate file (located in /ssl/)
|
- certfile=fullchain.pem # SSL certificate file (located in /ssl/)
|
||||||
- keyfile=privkey.pem # SSL key file (located in /ssl/)
|
- keyfile=privkey.pem # SSL key file (located in /ssl/)
|
||||||
@@ -53,8 +54,8 @@ Ensure you have the following installed on your system:
|
|||||||
- MQTT_PASSWORD_manual= # Optional: Manual MQTT password
|
- MQTT_PASSWORD_manual= # Optional: Manual MQTT password
|
||||||
- MQTT_PORT_manual= # Optional: Manual MQTT port
|
- MQTT_PORT_manual= # Optional: Manual MQTT port
|
||||||
- MQTT_USER_manual= # Optional: Manual MQTT user
|
- MQTT_USER_manual= # Optional: Manual MQTT user
|
||||||
- PULSE_SERVER=unix:/tmp/pulseaudio.socket
|
- PULSE_SERVER=unix:/tmp/pulseaudio.socket
|
||||||
- PULSE_COOKIE=/tmp/pulseaudio.cookie
|
- PULSE_COOKIE=/tmp/pulseaudio.cookie
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- ./config:/config # All your configuration files - and location of the default Birdsongs folder
|
- ./config:/config # All your configuration files - and location of the default Birdsongs folder
|
||||||
|
|||||||
@@ -76,6 +76,7 @@
|
|||||||
"LIVESTREAM_BOOT_ENABLED": false,
|
"LIVESTREAM_BOOT_ENABLED": false,
|
||||||
"MQTT_DISABLED": true,
|
"MQTT_DISABLED": true,
|
||||||
"TZ": "Europe/Paris",
|
"TZ": "Europe/Paris",
|
||||||
|
"Use_tphakala_model_v2": false,
|
||||||
"certfile": "fullchain.pem",
|
"certfile": "fullchain.pem",
|
||||||
"keyfile": "privkey.pem",
|
"keyfile": "privkey.pem",
|
||||||
"ssl": false
|
"ssl": false
|
||||||
@@ -103,6 +104,7 @@
|
|||||||
"MQTT_PORT_manual": "int?",
|
"MQTT_PORT_manual": "int?",
|
||||||
"MQTT_USER_manual": "str?",
|
"MQTT_USER_manual": "str?",
|
||||||
"TZ": "str?",
|
"TZ": "str?",
|
||||||
|
"Use_tphakala_model_v2": "bool",
|
||||||
"certfile": "str",
|
"certfile": "str",
|
||||||
"cifsdomain": "str?",
|
"cifsdomain": "str?",
|
||||||
"cifspassword": "str?",
|
"cifspassword": "str?",
|
||||||
|
|||||||
@@ -42,6 +42,27 @@ fi
|
|||||||
# General elements
|
# General elements
|
||||||
##################
|
##################
|
||||||
|
|
||||||
|
# Use tphakala model v2 if enabled
|
||||||
|
if [[ -f "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite2" ]]; then
|
||||||
|
mv "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite2" "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite"
|
||||||
|
fi
|
||||||
|
if [[ -d "$HOME/BirdNET-Pi/model/labels_nm2" ]]; then
|
||||||
|
mv "$HOME/BirdNET-Pi/model/labels_nm2" "$HOME/BirdNET-Pi/model/labels_nm"
|
||||||
|
fi
|
||||||
|
if bashio::config.true 'Use_tphakala_model_v2'; then
|
||||||
|
echo "... applying tphakala model v2"
|
||||||
|
if [[ -f "$HOME/BirdNET-Pi/model/BirdNET-Go_classifier.tflite" ]] && [[ -d "$HOME/BirdNET-Pi/model/labels_go" ]]; then
|
||||||
|
# Move labels
|
||||||
|
mv "$HOME/BirdNET-Pi/model/labels_nm" "$HOME/BirdNET-Pi/model/labels_nm2" || bashio::log.warning "Failed to move labels_nm"
|
||||||
|
mv "$HOME/BirdNET-Pi/model/labels_go" "$HOME/BirdNET-Pi/model/labels_nm" || bashio::log.warning "Failed to move labels_go"
|
||||||
|
# Move model
|
||||||
|
mv "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite" "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite2" || bashio::log.warning "Failed to move base model"
|
||||||
|
mv "$HOME/BirdNET-Pi/model/BirdNET-Go_classifier.tflite" "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite" || bashio::log.warning "Failed to move Go classifier"
|
||||||
|
else
|
||||||
|
bashio::log.fatal "model or labels not found, skipping"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Correct language labels according to birdnet.conf
|
# Correct language labels according to birdnet.conf
|
||||||
echo "... adapting labels according to birdnet.conf"
|
echo "... adapting labels according to birdnet.conf"
|
||||||
if export "$(grep "^DATABASE_LANG" /config/birdnet.conf)"; then
|
if export "$(grep "^DATABASE_LANG" /config/birdnet.conf)"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user