Skip to content

Commit a07855c

Browse files
allow to not filter SpeciesNet results by regional taxa
1 parent 4c35cb0 commit a07855c

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

AddaxAI_GUI.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,7 @@ def csv_to_coco(detections_df, files_df, output_path):
923923

924924
# create dict with country codes for speciesnet
925925
countries = [
926+
"NONE \tDon't filter by regional taxa and allow all species to be present in the results",
926927
"ABW \tAruba",
927928
"AFG \tAfghanistan",
928929
"AGO \tAngola",
@@ -1222,6 +1223,7 @@ def csv_to_coco(detections_df, files_df, output_path):
12221223
"ZMB \tZambia",
12231224
"ZWE \tZimbabwe"
12241225
]
1226+
12251227
# for simplicity, the same list is used for both english as spanish I'll fix everything properly in the new version
12261228
dpd_options_sppnet_location = [countries, countries]
12271229

@@ -4885,10 +4887,11 @@ def deploy_speciesnet(chosen_folder, sppnet_output_window, simple_mode = False):
48854887
# get location information
48864888
location_args = []
48874889
country_code = var_sppnet_location.get()[:3]
4888-
location_args.append(f"--country={country_code}")
4889-
if country_code == "USA":
4890-
state_code = var_sppnet_location.get()[4:6]
4891-
location_args.append(f"--admin1_region={state_code}")
4890+
if country_code != "NON": # only add location args if not selected 'NONE' option
4891+
location_args.append(f"--country={country_code}")
4892+
if country_code == "USA":
4893+
state_code = var_sppnet_location.get()[4:6]
4894+
location_args.append(f"--admin1_region={state_code}")
48924895
write_global_vars({
48934896
"var_sppnet_location_idx": dpd_options_sppnet_location[lang_idx].index(var_sppnet_location.get())
48944897
})

0 commit comments

Comments
 (0)