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

How do I convert a mask to a polygon #10397

Closed
ViaGun opened this issue Nov 26, 2021 · 4 comments
Closed

How do I convert a mask to a polygon #10397

ViaGun opened this issue Nov 26, 2021 · 4 comments
Assignees
Labels

Comments

@ViaGun
Copy link

ViaGun commented Nov 26, 2021

I would like to know how I can get polygon points from detections['mask'] detected with custom mask rcnn model.

for image_path in TEST_IMAGE_PATHS:
      frame = cv2.imread(str(image_path))
      # opencv's default is BGR, not RGB But we seems to produce RGB JPG files
      image_np = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
      image_np_with_detections = image_np.copy()

      # inference image
      input_tensor = np.expand_dims(image_np_with_detections, 0) 
      
      detections = model(input_tensor)
      print(detections['detection_masks'][0])
@kumariko
Copy link

@ViaGun Could you please have a look on the link1 , link2 and let us know if it helps? Thanks!

@kumariko kumariko added the stat:awaiting response Waiting on input from the contributor label Nov 26, 2021
@google-ml-butler
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you.

@google-ml-butler
Copy link

Closing as stale. Please reopen if you'd like to work on this further.

@google-ml-butler
Copy link

Are you satisfied with the resolution of your issue?
Yes
No

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants