jayn95 commited on
Commit
2a6d02c
·
verified ·
1 Parent(s): a1c1caa

Update periodontitis_detection.py

Browse files
Files changed (1) hide show
  1. periodontitis_detection.py +9 -1
periodontitis_detection.py CHANGED
@@ -226,7 +226,15 @@ 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
- combined = img_bgr.copy()
 
 
 
 
 
 
 
 
230
  all_results = []
231
 
232
  for det in detections:
 
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
232
+ overlay[abc_mask == 1] = (255, 0, 0) # Blue for ABC
233
+
234
+ # Blend overlay with original
235
+ alpha = 0.4
236
+ combined = cv2.addWeighted(overlay, alpha, img_bgr, 1 - alpha, 0)
237
+
238
  all_results = []
239
 
240
  for det in detections: