From b3f21dd95d14eda4faa47be8b359596f5abe1133 Mon Sep 17 00:00:00 2001 From: Tong Gao Date: Sat, 28 Jan 2023 11:08:01 +0800 Subject: [PATCH] [Fix] Explictly create np object array for compatability (#1691) --- mmocr/utils/polygon_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mmocr/utils/polygon_utils.py b/mmocr/utils/polygon_utils.py index c505b340..1d532dc7 100644 --- a/mmocr/utils/polygon_utils.py +++ b/mmocr/utils/polygon_utils.py @@ -332,7 +332,7 @@ def offset_polygon(poly: ArrayLike, distance: float) -> ArrayLike: pco.AddPath(poly, pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON) # Returned result will be in type of int32, convert it back to float32 # following MMOCR's convention - result = np.array(pco.Execute(distance)) + result = np.array(pco.Execute(distance), dtype=object) if len(result) > 0 and isinstance(result[0], list): # The processed polygon has been split into several parts result = np.array([])