Spaces:
Sleeping
Sleeping
Updated app.py showing gingivitis interpretation and results
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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
|