jsbroks / imantics

:camera: Reactive python package for managing, creating and visualizing different deep-learning image annotation formats
https://imantics.rtfd.io
MIT License
364 stars 68 forks source link

Is it possible to smooth the mask polygons? #35

Closed bpmsilva closed 4 years ago

bpmsilva commented 4 years ago

I'm generating coco jsons from binary masks and correcting them with the COCO annotator tool. However, sometimes, too many control points are generated, which increases the size of the jsons, complicates the correction and results in unnatural masks. I was wondering if it is possible to smooth the generated polygons reducing the number of generated control points

Thanks in advance

jsbroks commented 4 years ago

You can manipulate the data into the correct format to pass it in to: https://github.com/omarestrella/simplify.py/blob/master/simplify.py

bpmsilva commented 4 years ago

I noticed that the COCO annotator uses simplify with a default tolerance of 1, right? After I import the data, there are many points. However, when I click save, the polygons are smoothed. I think the default value of 1 is reasonable for my application, so I won't need to change anything. Thanks