You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
jessearmandse
changed the title
Feature Request: Polygons validation, Export Mask images improvement
[Feature Request] Polygons validation, Export Mask images improvement
Jan 7, 2025
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.
An example of validation in python is the following:
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._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.
The text was updated successfully, but these errors were encountered: