[Fix] Explictly create np object array for compatability (#1691)

pull/1694/head
Tong Gao 2023-01-28 11:08:01 +08:00 committed by GitHub
parent 7f4a1eecdc
commit b3f21dd95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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([])