Skip to content

Commit 7d03560

Browse files
committed
Exclude nested contours from contour confidence calculation
1 parent cc6e3cf commit 7d03560

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/python/model_api/models/segmentation.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,14 @@ def get_contours(
233233
color=1,
234234
thickness=-1,
235235
)
236+
for c in children:
237+
cv2.drawContours(
238+
mask,
239+
np.asarray([c]),
240+
contourIdx=-1,
241+
color=0,
242+
thickness=-1,
243+
)
236244
probability = cv2.mean(current_label_soft_prediction, mask)[0]
237245
combined_contours.append(Contour(label, probability, contour, children))
238246

0 commit comments

Comments
 (0)