From 34a50de0748b73626eec47ef662e2b6c57832560 Mon Sep 17 00:00:00 2001 From: Mountchicken Date: Tue, 25 Jul 2023 20:28:55 +0800 Subject: [PATCH] [Update] Fix bug --- mmocr/models/textdet/detectors/mmdet_wrapper.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mmocr/models/textdet/detectors/mmdet_wrapper.py b/mmocr/models/textdet/detectors/mmdet_wrapper.py index 1d6be8caa..49de8482c 100644 --- a/mmocr/models/textdet/detectors/mmdet_wrapper.py +++ b/mmocr/models/textdet/detectors/mmdet_wrapper.py @@ -138,6 +138,7 @@ def adapt_predictions(self, data: MMDET_SampleList, # convert by text_repr_type if self.text_repr_type == 'quad': for j, poly in enumerate(filterd_polygons): + poly = poly.reshape(-1, 2) rect = cv2.minAreaRect(poly) vertices = cv2.boxPoints(rect) poly = vertices.flatten()