Spaces:
Sleeping
Sleeping
YonaniCodes commited on
Commit ·
4529bef
1
Parent(s): 5862b7f
at least ready
Browse files
app.py
CHANGED
|
@@ -33,6 +33,10 @@ def predict_breed(image):
|
|
| 33 |
predicted_class_index = np.argmax(predictions[0])
|
| 34 |
predicted_class = unique_breeds[predicted_class_index]
|
| 35 |
confidence = predictions[0][predicted_class_index] * 100 # Convert to percentage
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
return image, f"{predicted_class} ({confidence:.2f}%)"
|
| 37 |
|
| 38 |
# Create Gradio interface
|
|
|
|
| 33 |
predicted_class_index = np.argmax(predictions[0])
|
| 34 |
predicted_class = unique_breeds[predicted_class_index]
|
| 35 |
confidence = predictions[0][predicted_class_index] * 100 # Convert to percentage
|
| 36 |
+
|
| 37 |
+
# Replace underscores with spaces in the class name
|
| 38 |
+
predicted_class = predicted_class.replace('_', ' ')
|
| 39 |
+
|
| 40 |
return image, f"{predicted_class} ({confidence:.2f}%)"
|
| 41 |
|
| 42 |
# Create Gradio interface
|