Update app.py
Browse files
app.py
CHANGED
|
@@ -13,7 +13,7 @@ output_details = interpreter.get_output_details()
|
|
| 13 |
|
| 14 |
# Class labels
|
| 15 |
class_names = ['Dyskeratotic', 'Koilocytotic', 'Metaplastic', 'Parabasal', 'Superficial-Intermediat']
|
| 16 |
-
CONFIDENCE_THRESHOLD = 0.
|
| 17 |
|
| 18 |
def predict_image(image):
|
| 19 |
try:
|
|
@@ -31,7 +31,7 @@ def predict_image(image):
|
|
| 31 |
if confidence < CONFIDENCE_THRESHOLD:
|
| 32 |
return f"⚠️ Low confidence ({confidence:.2f}). The model is unsure. Please try a clearer image."
|
| 33 |
else:
|
| 34 |
-
return f"✅ Prediction: {class_names[class_idx]}
|
| 35 |
except Exception as e:
|
| 36 |
return f"Error: {str(e)}"
|
| 37 |
|
|
|
|
| 13 |
|
| 14 |
# Class labels
|
| 15 |
class_names = ['Dyskeratotic', 'Koilocytotic', 'Metaplastic', 'Parabasal', 'Superficial-Intermediat']
|
| 16 |
+
CONFIDENCE_THRESHOLD = 0.25
|
| 17 |
|
| 18 |
def predict_image(image):
|
| 19 |
try:
|
|
|
|
| 31 |
if confidence < CONFIDENCE_THRESHOLD:
|
| 32 |
return f"⚠️ Low confidence ({confidence:.2f}). The model is unsure. Please try a clearer image."
|
| 33 |
else:
|
| 34 |
+
return f"✅ Prediction: {class_names[class_idx]}"
|
| 35 |
except Exception as e:
|
| 36 |
return f"Error: {str(e)}"
|
| 37 |
|