Spaces:
Sleeping
Sleeping
Update periodontitis_detection.py
Browse files
periodontitis_detection.py
CHANGED
|
@@ -226,6 +226,8 @@ class SimpleDentalSegmentationNoEnhance:
|
|
| 226 |
abc_mask = self.resize_mask_to_original(abc_unet, (h_orig, w_orig))
|
| 227 |
detections = self.detect_teeth(img_bgr)
|
| 228 |
|
|
|
|
|
|
|
| 229 |
# Create a color overlay for CEJ (red) and ABC (blue)
|
| 230 |
overlay = img_bgr.copy()
|
| 231 |
overlay[cej_mask == 1] = (0, 0, 255) # Red for CEJ
|
|
@@ -239,7 +241,7 @@ class SimpleDentalSegmentationNoEnhance:
|
|
| 239 |
|
| 240 |
for det in detections:
|
| 241 |
x1, y1, x2, y2 = det["bbox"].astype(int)
|
| 242 |
-
cv2.rectangle(combined, (x1, y1), (x2, y2), (0, 255, 0),
|
| 243 |
cv2.putText(
|
| 244 |
combined,
|
| 245 |
f"Tooth {det['tooth_id']}",
|
|
|
|
| 226 |
abc_mask = self.resize_mask_to_original(abc_unet, (h_orig, w_orig))
|
| 227 |
detections = self.detect_teeth(img_bgr)
|
| 228 |
|
| 229 |
+
print(f"Detected {len(detections)} teeth")
|
| 230 |
+
|
| 231 |
# Create a color overlay for CEJ (red) and ABC (blue)
|
| 232 |
overlay = img_bgr.copy()
|
| 233 |
overlay[cej_mask == 1] = (0, 0, 255) # Red for CEJ
|
|
|
|
| 241 |
|
| 242 |
for det in detections:
|
| 243 |
x1, y1, x2, y2 = det["bbox"].astype(int)
|
| 244 |
+
cv2.rectangle(combined, (x1, y1), (x2, y2), (0, 255, 0), 3)
|
| 245 |
cv2.putText(
|
| 246 |
combined,
|
| 247 |
f"Tooth {det['tooth_id']}",
|