Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Polygons validation, Export Mask images improvement #270

Open
jessearmandse opened this issue Jan 7, 2025 · 1 comment

Comments

@jessearmandse
Copy link

  1. Is it possible to integrate a polygon validation feature into the app?

An example of validation in python is the following:

def shape2mask(img_size, points):
    label_mask = PIL.Image.fromarray(np.zeros(img_size[:2], dtype=np.uint8))
    image_draw = PIL.ImageDraw.Draw(label_mask)
    points_list = [tuple(point) for point in points]
    assert len(points_list) > 2, 'Polygon must have points more than 2'
    image_draw.polygon(xy=points_list, outline=1, fill=1)
    return np.array(label_mask, dtype=bool)

It simply validate whether the number of points are more than 2. These problems could occur when editing some polygons with erase mask operation.

This can be a part of Export mask images feature, or it can be a standalone feature, where I can validate polygon from a menu action.

  1. When we're exporting mask images, can we have an option to not use the _all_objects suffix on the filename?
    Because typically during training we want to structure the masks in a way that it can be identified easily with the images, and having _all_objects adds extra processing.

Although it's simple to just rename them, often it's also unnecessary at the beginning to have this suffix, some people may want it, I'm not very sure of that. It may be better to have it as an option.

@jessearmandse jessearmandse changed the title Feature Request: Polygons validation, Export Mask images improvement [Feature Request] Polygons validation, Export Mask images improvement Jan 7, 2025
@ryouchinsa
Copy link
Owner

In the latest version 2025.01.11, polygons which include less than 3 points are skipped when export mask images, and the "_all_objects" suffix was removed.

annotation
mask_list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants