Various fixes (#17342)

* Remove imutils

* Ensure that state is maintained when setting search params

* Change script for version of setuptools

* Fix

* Fix
This commit is contained in:
Nicolas Mowen
2025-03-24 12:25:36 -05:00
committed by GitHub
parent 05d39f79b0
commit eabc316c7b
9 changed files with 29 additions and 12 deletions
+13
View File
@@ -265,6 +265,19 @@ def draw_box_with_label(
)
def grab_cv2_contours(cnts):
# if the length the contours tuple returned by cv2.findContours
# is '2' then we are using either OpenCV v2.4, v4-beta, or
# v4-official
if len(cnts) == 2:
return cnts[0]
# if the length of the contours tuple is '3' then we are using
# either OpenCV v3, v4-pre, or v4-alpha
elif len(cnts) == 3:
return cnts[1]
def is_label_printable(label) -> bool:
"""Check if label is printable."""
return not bool(set(label) - set(printable))