google-research-datasets / hiertext

The HierText dataset contains ~12k images from the Open Images dataset v6 with large amount of text entities. We provide word, line and paragraph level annotations.
Creative Commons Attribution Share Alike 4.0 International
249 stars 20 forks source link

Masks to Polygons code #11

Closed bely66 closed 1 year ago

bely66 commented 1 year ago

Hi Everyone, It seems you're using a special mask shape, however I want to get polygons from the masks. is there any code to help with that?

Jyouhou commented 1 year ago

what mask shapes are you referring to? Can you be more specific?

bely66 commented 1 year ago

I'm trying to convert the labels of the word level annotations from masks to polygons (4 point polygon), all the annotations are masks

Jyouhou commented 1 year ago

cv2.minarearect is what you need