From 93d883e7dc33d01f97e4fd1ba8cfcb62e3820985 Mon Sep 17 00:00:00 2001 From: Xinyu Wang <45810070+xinke-wang@users.noreply.github.com> Date: Fri, 16 Sep 2022 14:02:24 +0800 Subject: [PATCH] [Fix] Fix a bug in MMDetWrapper --- mmocr/models/textdet/detectors/mmdet_wrapper.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmocr/models/textdet/detectors/mmdet_wrapper.py b/mmocr/models/textdet/detectors/mmdet_wrapper.py index 54bf7738..d4091060 100644 --- a/mmocr/models/textdet/detectors/mmdet_wrapper.py +++ b/mmocr/models/textdet/detectors/mmdet_wrapper.py @@ -137,11 +137,11 @@ class MMDetWrapper(BaseModel): keep_idx.append(poly_idx) # convert by text_repr_type if self.text_repr_type == 'quad': - for i, poly in enumerate(filterd_polygons): + for j, poly in enumerate(filterd_polygons): rect = cv2.minAreaRect(poly) vertices = cv2.boxPoints(rect) poly = vertices.flatten() - filterd_polygons[i] = poly + filterd_polygons[j] = poly data_samples[i].pred_instances.polygons = filterd_polygons data_samples[i].pred_instances.scores = torch.FloatTensor(