abuhanzala commited on
Commit
c86f10f
·
verified ·
1 Parent(s): b002185

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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.7
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]} (Confidence: {confidence:.2f})"
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