Skip to content

Commit 2a5292c

Browse files
authored
AC: fix text detection adapter (#3658)
1 parent 7da76ab commit 2a5292c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/accuracy_checker/openvino/tools/accuracy_checker/adapters/text_detection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,10 @@ def min_area_rect(contour):
154154
for bbox_idx in range(1, max_bbox_idx + 1):
155155
bbox_mask = (mask == bbox_idx).astype(np.uint8)
156156
cnts = cv2.findContours(bbox_mask, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE)[-2]
157-
if np.size(cnts) == 0:
157+
158+
if not cnts:
158159
continue
160+
159161
cnt = cnts[0]
160162
rect, rect_area = min_area_rect(cnt)
161163

0 commit comments

Comments
 (0)