Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,8 +27,6 @@ def detect_periodontitis(image_np):
|
|
| 27 |
|
| 28 |
# Convert OpenCV BGR → RGB for Gradio display
|
| 29 |
combined_rgb = cv2.cvtColor(results["combined"], cv2.COLOR_BGR2RGB)
|
| 30 |
-
cej_mask_rgb = cv2.cvtColor(results["cej_mask"] * 255, cv2.COLOR_GRAY2RGB)
|
| 31 |
-
abc_mask_rgb = cv2.cvtColor(results["abc_mask"] * 255, cv2.COLOR_GRAY2RGB)
|
| 32 |
|
| 33 |
# Optional: summarize measurements for text output
|
| 34 |
summaries = []
|
|
@@ -43,7 +41,7 @@ def detect_periodontitis(image_np):
|
|
| 43 |
|
| 44 |
summary_text = "\n".join(summaries) if summaries else "No detections found."
|
| 45 |
|
| 46 |
-
return combined_rgb,
|
| 47 |
|
| 48 |
|
| 49 |
# ==========================
|
|
@@ -54,8 +52,6 @@ demo = gr.Interface(
|
|
| 54 |
inputs=gr.Image(type="numpy", label="Upload Dental X-Ray"),
|
| 55 |
outputs=[
|
| 56 |
gr.Image(label="Final Annotated Image (YOLO + CEJ–ABC)"),
|
| 57 |
-
gr.Image(label="CEJ Segmentation Mask"),
|
| 58 |
-
gr.Image(label="ABC Segmentation Mask"),
|
| 59 |
gr.Textbox(label="Analysis Summary"),
|
| 60 |
],
|
| 61 |
title="🦷 Periodontitis Detection & Analysis",
|
|
|
|
| 27 |
|
| 28 |
# Convert OpenCV BGR → RGB for Gradio display
|
| 29 |
combined_rgb = cv2.cvtColor(results["combined"], cv2.COLOR_BGR2RGB)
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Optional: summarize measurements for text output
|
| 32 |
summaries = []
|
|
|
|
| 41 |
|
| 42 |
summary_text = "\n".join(summaries) if summaries else "No detections found."
|
| 43 |
|
| 44 |
+
return combined_rgb, summary_text
|
| 45 |
|
| 46 |
|
| 47 |
# ==========================
|
|
|
|
| 52 |
inputs=gr.Image(type="numpy", label="Upload Dental X-Ray"),
|
| 53 |
outputs=[
|
| 54 |
gr.Image(label="Final Annotated Image (YOLO + CEJ–ABC)"),
|
|
|
|
|
|
|
| 55 |
gr.Textbox(label="Analysis Summary"),
|
| 56 |
],
|
| 57 |
title="🦷 Periodontitis Detection & Analysis",
|