Skip to content

Commit 91e5fff

Browse files
committed
Resolve some of corner-cases
1 parent e444834 commit 91e5fff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/python/model_api/models/segmentation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,8 @@ def get_contours(
212212
cv2.RETR_CCOMP,
213213
cv2.CHAIN_APPROX_NONE,
214214
)
215-
hierarchy = hierarchy.squeeze()
215+
if len(contours):
216+
hierarchy = hierarchy.squeeze(axis=0)
216217

217218
for i, contour in enumerate(contours):
218219
if hierarchy[i][3] >= 0:

0 commit comments

Comments
 (0)