andrewzamp commited on
Commit
2fb1923
·
1 Parent(s): 68bd012

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -60,7 +60,13 @@ def make_prediction(image, taxonomic_decision, taxonomic_level):
60
 
61
  # Initialize variables for aggregated predictions and level index
62
  aggregated_predictions = None
63
- current_level_index = taxonomic_levels.index(taxonomic_level)
 
 
 
 
 
 
64
 
65
  # Loop through taxonomic levels to check confidence
66
  while current_level_index < len(taxonomic_levels):
 
60
 
61
  # Initialize variables for aggregated predictions and level index
62
  aggregated_predictions = None
63
+ current_level_index = 0 # Start from the species level
64
+
65
+ # Determine the initial taxonomic level based on the user's decision
66
+ if taxonomic_decision == "No, I will let the model decide":
67
+ current_level_index = 0 # Start at species level if letting the model decide
68
+ else:
69
+ current_level_index = taxonomic_levels.index(taxonomic_level) # Use specified level
70
 
71
  # Loop through taxonomic levels to check confidence
72
  while current_level_index < len(taxonomic_levels):