[Fix] Fix a bug in MMDetWrapper

pull/1326/head
Xinyu Wang 2022-09-16 14:02:24 +08:00 committed by GitHub
parent 87f15b3135
commit 93d883e7dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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(