Skip to content

Commit b3f21dd

Browse files
authored
[Fix] Explictly create np object array for compatability (#1691)
1 parent 7f4a1ee commit b3f21dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mmocr/utils/polygon_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def offset_polygon(poly: ArrayLike, distance: float) -> ArrayLike:
332332
pco.AddPath(poly, pyclipper.JT_ROUND, pyclipper.ET_CLOSEDPOLYGON)
333333
# Returned result will be in type of int32, convert it back to float32
334334
# following MMOCR's convention
335-
result = np.array(pco.Execute(distance))
335+
result = np.array(pco.Execute(distance), dtype=object)
336336
if len(result) > 0 and isinstance(result[0], list):
337337
# The processed polygon has been split into several parts
338338
result = np.array([])

0 commit comments

Comments
 (0)