Spaces:
Sleeping
Sleeping
Commit
·
f90fa32
1
Parent(s):
22a6037
Update app.py
Browse files
app.py
CHANGED
@@ -83,8 +83,8 @@ def make_prediction(image, taxonomic_decision, taxonomic_level):
|
|
83 |
current_level_index += 1 # Move to the next taxonomic level
|
84 |
|
85 |
# Check if a valid prediction was made
|
86 |
-
|
87 |
-
|
88 |
|
89 |
# Get the predicted class name for the top prediction
|
90 |
predicted_class_index = np.argmax(aggregated_predictions)
|
|
|
83 |
current_level_index += 1 # Move to the next taxonomic level
|
84 |
|
85 |
# Check if a valid prediction was made
|
86 |
+
if current_level_index == len(taxonomic_levels):
|
87 |
+
return "<h1 style='font-weight: bold;'>Unknown animal</h1>" # No valid predictions met the confidence criteria
|
88 |
|
89 |
# Get the predicted class name for the top prediction
|
90 |
predicted_class_index = np.argmax(aggregated_predictions)
|