feat(birdnet-pi): add option for tphakala model v2

This commit is contained in:
Alexandre
2025-09-13 06:58:33 +02:00
parent 97bf267f2e
commit eab6887c95
4 changed files with 23 additions and 2 deletions

View File

@@ -42,6 +42,23 @@ fi
# General elements
##################
# Use tphakala model v2 if enabled
if bashio::config.true 'Use_tphakala_model_v2'; then
echo "... applying tphakala model v2"
if [ -d "$HOME/BirdNET-Pi/model/labels_nm" ]; then
mv "$HOME/BirdNET-Pi/model/labels_nm" "$HOME/BirdNET-Pi/model/labels_nm2" || bashio::log.warning "Failed to move labels_nm"
fi
if [ -d "$HOME/BirdNET-Pi/model/labels_go" ]; then
mv "$HOME/BirdNET-Pi/model/labels_go" "$HOME/BirdNET-Pi/model/labels_nm" || bashio::log.warning "Failed to move labels_go"
fi
if [ -f "$HOME/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite" ]; then
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"
fi
if [ -f "$HOME/BirdNET-Pi/model/BirdNET-Go_classifier.tflite" ]; then
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"
fi
fi
# Correct language labels according to birdnet.conf
echo "... adapting labels according to birdnet.conf"
if export "$(grep "^DATABASE_LANG" /config/birdnet.conf)"; then