From 31e1379f14d061e3ac8f93088669d5caa865bd69 Mon Sep 17 00:00:00 2001 From: frederik Date: Mon, 19 Feb 2024 14:39:25 +0100 Subject: [PATCH] server.py add support for Data_Model_V2 --- scripts/server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/server.py b/scripts/server.py index 11fa9c8..ea4e563 100755 --- a/scripts/server.py +++ b/scripts/server.py @@ -72,8 +72,13 @@ def loadMetaModel(): global M_INPUT_LAYER_INDEX global M_OUTPUT_LAYER_INDEX + if get_settings().getint('DATA_MODEL_VERSION') == 2: + data_model = 'BirdNET_GLOBAL_6K_V2.4_MData_Model_V2_FP16.tflite' + else: + data_model = 'BirdNET_GLOBAL_6K_V2.4_MData_Model_FP16.tflite' + # Load TFLite model and allocate tensors. - M_INTERPRETER = tflite.Interpreter(model_path=userDir + '/BirdNET-Pi/model/BirdNET_GLOBAL_6K_V2.4_MData_Model_FP16.tflite') + M_INTERPRETER = tflite.Interpreter(model_path=os.path.join(userDir, 'BirdNET-Pi/model', data_model)) M_INTERPRETER.allocate_tensors() # Get input and output tensors.