diff --git a/ppocr/data/imaug/iaa_augment.py b/ppocr/data/imaug/iaa_augment.py index d35242c14c..2d1f615e28 100644 --- a/ppocr/data/imaug/iaa_augment.py +++ b/ppocr/data/imaug/iaa_augment.py @@ -208,5 +208,5 @@ def __call__(self, data): new_poly = transformed_keypoints[idx : idx + length] new_polys.append(np.array([kp[:2] for kp in new_poly])) idx += length - data["polys"] = new_polys + data["polys"] = np.array(new_polys) return data diff --git a/tests/test_iaa_augment.py b/tests/test_iaa_augment.py index 64577692f8..a03323f3c6 100644 --- a/tests/test_iaa_augment.py +++ b/tests/test_iaa_augment.py @@ -50,7 +50,9 @@ def test_iaa_augment_default(sample_image, sample_polys): assert isinstance( transformed_data["image"], np.ndarray ), "Image should be a numpy array" - assert isinstance(transformed_data["polys"], list), "Polys should be a list" + assert isinstance( + transformed_data["polys"], np.ndarray + ), "Polys should be a numpy array" assert transformed_data["image"].ndim == 3, "Image should be 3-dimensional" # Verify that the polygons have been transformed