Update server.py

This commit is contained in:
ehpersonal38
2023-01-14 17:41:59 -05:00
parent 235b9ca94b
commit 112f40e192
+2 -2
View File
@@ -64,7 +64,7 @@ def loadModel():
print('LOADING TF LITE MODEL...', end=' ') print('LOADING TF LITE MODEL...', end=' ')
# Load TFLite model and allocate tensors. # Load TFLite model and allocate tensors.
# model will either be BirdNET_GLOBAL_3K_V2.2_MData_Model_FP16 (new) or BirdNET_6K_GLOBAL_MODEL (old) # model will either be BirdNET_GLOBAL_3K_V2.2_Model_FP16 (new) or BirdNET_6K_GLOBAL_MODEL (old)
modelpath = userDir + '/BirdNET-Pi/model/'+model+'.tflite' modelpath = userDir + '/BirdNET-Pi/model/'+model+'.tflite'
myinterpreter = tflite.Interpreter(model_path=modelpath, num_threads=2) myinterpreter = tflite.Interpreter(model_path=modelpath, num_threads=2)
myinterpreter.allocate_tensors() myinterpreter.allocate_tensors()
@@ -263,7 +263,7 @@ def analyzeAudioData(chunks, lat, lon, week, sensitivity, overlap,):
start = time.time() start = time.time()
print('ANALYZING AUDIO...', end=' ', flush=True) print('ANALYZING AUDIO...', end=' ', flush=True)
if model == "BirdNET_GLOBAL_3K_V2.2_MData_Model_FP16": if model == "BirdNET_GLOBAL_3K_V2.2_Model_FP16":
if len(PREDICTED_SPECIES_LIST) == 0: if len(PREDICTED_SPECIES_LIST) == 0:
predictSpeciesList(lat,lon,week) predictSpeciesList(lat,lon,week)