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

Convert Single mask image to polygon #61

Open
sctrueew opened this issue Oct 20, 2022 · 0 comments
Open

Convert Single mask image to polygon #61

sctrueew opened this issue Oct 20, 2022 · 0 comments

Comments

@sctrueew
Copy link

Hi, Thanks for your work

How can I get polygon and points from an image? I use this but not working

Mask example:
image

import numpy as np
from imantics import Polygons, Mask
from PIL import Image
instance_path = r"test.png"
instance_image = Image.open(instance_path)
instance_array = np.array(instance_image)
polygons = Mask(instance_array).polygons()

print(polygons.points)
print(polygons.segmentation)
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

1 participant