fix: compatible with opencv under version 4.4.0
parent
de65a13e53
commit
de859b4a3d
|
@ -78,6 +78,9 @@ class UnifiedResize(object):
|
|||
if backend.lower() == "cv2":
|
||||
if isinstance(interpolation, str):
|
||||
interpolation = _cv2_interp_from_str[interpolation.lower()]
|
||||
# compatible with opencv < version 4.4.0
|
||||
elif not interpolation:
|
||||
interpolation = cv2.INTER_LINEAR
|
||||
self.resize_func = partial(cv2.resize, interpolation=interpolation)
|
||||
elif backend.lower() == "pil":
|
||||
if isinstance(interpolation, str):
|
||||
|
|
|
@ -59,6 +59,9 @@ class UnifiedResize(object):
|
|||
if backend.lower() == "cv2":
|
||||
if isinstance(interpolation, str):
|
||||
interpolation = _cv2_interp_from_str[interpolation.lower()]
|
||||
# compatible with opencv < version 4.4.0
|
||||
elif not interpolation:
|
||||
interpolation = cv2.INTER_LINEAR
|
||||
self.resize_func = partial(cv2.resize, interpolation=interpolation)
|
||||
elif backend.lower() == "pil":
|
||||
if isinstance(interpolation, str):
|
||||
|
|
Loading…
Reference in New Issue