Spaces:
Sleeping
Sleeping
Commit
·
8137f13
1
Parent(s):
9f8bab0
Update app.py
Browse files
app.py
CHANGED
@@ -48,7 +48,7 @@ def load_and_preprocess_image(image, target_size=(224, 224)):
|
|
48 |
return img_array
|
49 |
|
50 |
# Function to make predictions
|
51 |
-
def make_prediction(image, taxonomic_level):
|
52 |
# Preprocess the image
|
53 |
img_array = load_and_preprocess_image(image)
|
54 |
|
@@ -62,7 +62,7 @@ def make_prediction(image, taxonomic_level):
|
|
62 |
current_taxonomic_level_index = taxonomic_levels.index(taxonomic_level)
|
63 |
|
64 |
# If the user chose to let the model decide, check the confidence levels
|
65 |
-
if
|
66 |
aggregated_predictions = prediction
|
67 |
while current_taxonomic_level_index < len(taxonomic_levels):
|
68 |
# Aggregate predictions based on the current taxonomic level
|
|
|
48 |
return img_array
|
49 |
|
50 |
# Function to make predictions
|
51 |
+
def make_prediction(image, taxonomic_resolution_choice, taxonomic_level):
|
52 |
# Preprocess the image
|
53 |
img_array = load_and_preprocess_image(image)
|
54 |
|
|
|
62 |
current_taxonomic_level_index = taxonomic_levels.index(taxonomic_level)
|
63 |
|
64 |
# If the user chose to let the model decide, check the confidence levels
|
65 |
+
if taxonomic_resolution_choice == "No, I will let the model decide":
|
66 |
aggregated_predictions = prediction
|
67 |
while current_taxonomic_level_index < len(taxonomic_levels):
|
68 |
# Aggregate predictions based on the current taxonomic level
|