albumentations
albumentations copied to clipboard
feature request: add support for polylines /contours
your tool is awesome!!
a very common type of label is polylines/polygones/contours (all really the same thing). Please please add support for it like you support bounding boxes.
Could you represent polygons as keypoints?
interesting.possibly. it depends how you defined key-points. Usually key-points types assume a consistent number of points. Polygons can be any number (> 3) of points.
The way albumentation treats keypoints shouldn't make this a problem since you also encounter that problem when having multiple different people in the same image or keypoints that aren't visible (out of frame). You can apply this same logic to polygons (set remove_invisible to False in A.compose though!): and then you simply clip the values of your polygon's vertices to the edges of your picture and you should obtain a transformed polygon ;)
@enaskopelja @vanderschuea I finally tried this today (rather than turning the polylines into a segmentation map and working with that)
I ran into the following issues:
- keypoints allows 1 set of keypoints to be transformed . I have multiple polylines.
- The decision if to keep a point is per point rather than per polyline so I might end up with part of a polyline that should strech to the edge of the image but doesn't. There needs to be polyline aware logic for cutting the polyline - more similar to how the bounding box methods work.
- (minor) kyepoints expects int? what's wrong with floats?