jayn95 commited on
Commit
259f6be
·
verified ·
1 Parent(s): bcbbf99

Updated app.py showing gingivitis interpretation and results

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -56,7 +56,19 @@ def detect_gingivitis(image, conf=0.4, iou=0.5):
56
  has_rd = len(rd_res[0].boxes) > 0
57
  has_bl = len(bl_res[0].boxes) > 0
58
 
59
- diagnosis = "Gingivitis Detected" if (has_sw and has_rd and has_bl) else "No Gingivitis Detected"
 
 
 
 
 
 
 
 
 
 
 
 
60
 
61
  # *** CRITICAL ***
62
  # Must return FILE PATHS + diagnosis string in ONE LIST
 
56
  has_rd = len(rd_res[0].boxes) > 0
57
  has_bl = len(bl_res[0].boxes) > 0
58
 
59
+ # ------------------------------
60
+ # UPDATED: CUSTOM DIAGNOSIS
61
+ # ------------------------------
62
+ if has_sw and has_rd and has_bl:
63
+ diagnosis = (
64
+ "🦷 **You have gingivitis.**\n\n"
65
+ "For accurate assessment and guidance, we recommend visiting your dentist for a professional evaluation "
66
+ "or second opinion. Gingivitis can progress into periodontitis if left untreated.\n\n"
67
+ "If you have a periapical X-ray available, you can use the **Detect Periodontitis** feature for further analysis.\n\n"
68
+ "**Would you like to proceed?**"
69
+ )
70
+ else:
71
+ diagnosis = "🟢 **You don't have gingivitis.**"
72
 
73
  # *** CRITICAL ***
74
  # Must return FILE PATHS + diagnosis string in ONE LIST