Spaces:
Sleeping
Sleeping
Commit
·
d7e6465
1
Parent(s):
2759d0e
Update app.py
Browse files
app.py
CHANGED
@@ -51,6 +51,10 @@ def load_and_preprocess_image(image, target_size=(224, 224)):
|
|
51 |
def make_prediction(image, taxonomic_level):
|
52 |
# Preprocess the image
|
53 |
img_array = load_and_preprocess_image(image)
|
|
|
|
|
|
|
|
|
54 |
# Make a prediction
|
55 |
prediction = model.predict(img_array)
|
56 |
|
|
|
51 |
def make_prediction(image, taxonomic_level):
|
52 |
# Preprocess the image
|
53 |
img_array = load_and_preprocess_image(image)
|
54 |
+
|
55 |
+
# Get the class names from the 'species' column
|
56 |
+
class_names = sorted(taxo_df['species'].unique()) # Add this line to define class_names
|
57 |
+
|
58 |
# Make a prediction
|
59 |
prediction = model.predict(img_array)
|
60 |
|