Skip to content

Commit

Permalink
fix annoying
Browse files Browse the repository at this point in the history
  • Loading branch information
Skwarson96 committed Jul 22, 2024
1 parent 979ce32 commit 7a2e144
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion salt/dataset_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ def parse_mask_to_coco(image_id, anno_id, image_mask, category_id, poly=False):
if poly == True:
for contour in contours:
sc = simplify_coords_vwp(contour[:,0,:], 2).ravel().tolist()
annotation["segmentation"].append(sc)
tol = 1e-3
cleaned = []
for x, y in zip(sc[::2], sc[1::2]):
if x > tol and y > tol:
cleaned.append(x)
cleaned.append(y)
annotation["segmentation"].append(cleaned)
return annotation


Expand Down

0 comments on commit 7a2e144

Please sign in to comment.