Attempt fix to parish
Browse files
app.py
CHANGED
@@ -138,11 +138,10 @@ def classify_image(input_image, model_name):
|
|
138 |
for label, confidence in parish_predictions[:5]
|
139 |
}
|
140 |
|
141 |
-
#
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
top_parish_label = f"From the Parish of {top_parish_label} / Mill-Parroċċa ta' {top_parish_label}"
|
146 |
|
147 |
# Get the label with the highest confidence
|
148 |
highest_confidence_label = predictions[0][0] # Assuming predictions are sorted by confidence
|
|
|
138 |
for label, confidence in parish_predictions[:5]
|
139 |
}
|
140 |
|
141 |
+
# Modify the first formatted prediction to include "From the Parish of ..."
|
142 |
+
first_label, first_confidence = parish_predictions[0]
|
143 |
+
formatted_parish_predictions[f"From the Parish of {first_label} / Mill-Parroċċa ta' {first_label}"] = formatted_parish_predictions.pop(first_label)
|
144 |
+
|
|
|
145 |
|
146 |
# Get the label with the highest confidence
|
147 |
highest_confidence_label = predictions[0][0] # Assuming predictions are sorted by confidence
|