From 09d5d9950dd4151472d9f460f76ef1ad99f5e2f9 Mon Sep 17 00:00:00 2001 From: no-username-found <80005926+no-username-found@users.noreply.github.com> Date: Sun, 22 Jun 2025 12:46:25 +0200 Subject: [PATCH] Bugfix: whitelist_species_list.txt will now overrule the Species Occurrence Frequency Threshold (#365) * Bugfix: whitelist_species_list.txt will now overrule the Species Occurrence Frequency Threshold --- scripts/server.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scripts/server.py b/scripts/server.py index 8552234..eb0db99 100644 --- a/scripts/server.py +++ b/scripts/server.py @@ -135,9 +135,6 @@ def predictSpeciesList(lat, lon, week): # if there's a custom user-made include list, we only want to use the species in that if (len(INCLUDE_LIST) == 0): PREDICTED_SPECIES_LIST.append(s[1]) - WHITELIST_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/whitelist_species_list.txt")) - for species in WHITELIST_LIST: - PREDICTED_SPECIES_LIST.append(species) def loadCustomSpeciesList(path): @@ -310,9 +307,10 @@ def load_global_model(): def run_analysis(file): - global INCLUDE_LIST, EXCLUDE_LIST + global INCLUDE_LIST, EXCLUDE_LIST, WHITELIST_LIST INCLUDE_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/include_species_list.txt")) EXCLUDE_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/exclude_species_list.txt")) + WHITELIST_LIST = loadCustomSpeciesList(os.path.expanduser("~/BirdNET-Pi/whitelist_species_list.txt")) conf = get_settings() @@ -335,7 +333,7 @@ def run_analysis(file): log.warning("Excluded as INCLUDE_LIST is active but this species is not in it: %s", entry[0]) elif entry[0] in EXCLUDE_LIST and len(EXCLUDE_LIST) != 0: log.warning("Excluded as species in EXCLUDE_LIST: %s", entry[0]) - elif entry[0] not in PREDICTED_SPECIES_LIST and len(PREDICTED_SPECIES_LIST) != 0: + elif entry[0] not in PREDICTED_SPECIES_LIST and len(PREDICTED_SPECIES_LIST) != 0 and entry[0] not in WHITELIST_LIST: log.warning("Excluded as below Species Occurrence Frequency Threshold: %s", entry[0]) else: d = Detection(