Skip to content

Commit 500381c

Browse files
authored
fix benchmark det_r50_vd_pse_v2_0 train error (#14239)
1 parent 7bbda2b commit 500381c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

ppocr/data/imaug/iaa_augment.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,5 +208,5 @@ def __call__(self, data):
208208
new_poly = transformed_keypoints[idx : idx + length]
209209
new_polys.append(np.array([kp[:2] for kp in new_poly]))
210210
idx += length
211-
data["polys"] = new_polys
211+
data["polys"] = np.array(new_polys)
212212
return data

tests/test_iaa_augment.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ def test_iaa_augment_default(sample_image, sample_polys):
5050
assert isinstance(
5151
transformed_data["image"], np.ndarray
5252
), "Image should be a numpy array"
53-
assert isinstance(transformed_data["polys"], list), "Polys should be a list"
53+
assert isinstance(
54+
transformed_data["polys"], np.ndarray
55+
), "Polys should be a numpy array"
5456
assert transformed_data["image"].ndim == 3, "Image should be 3-dimensional"
5557

5658
# Verify that the polygons have been transformed

0 commit comments

Comments
 (0)