Skip to content

Commit

Permalink
[Fix] Fix a bug in MMDetWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
xinke-wang authored Sep 16, 2022
1 parent 87f15b3 commit 93d883e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mmocr/models/textdet/detectors/mmdet_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ def adapt_predictions(self, data: MMDET_SampleList,
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(
Expand Down

0 comments on commit 93d883e

Please sign in to comment.