facebookresearch / facebookresearch/sam2

Segment multiple objects simultaneously on the same mask for images.

Open
#419 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
19.9k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

Is there a way to segment multiple objects simultaneously on the same output mask for images?

Let's say I want to segment *B* number of objects in my image. Let's also assume that I have *n* number of foreground points for each of those *B* objects. If create a *point_coords* batch with the shape *[B, n, 2]*, with *multimask_output* set to *False*, I get an output of shape *[B, 1, img_height, img_width]*. Essentially, I get *B* number of binary masks -- one for each of my *B* objects.

Is there a way of getting a **single non-binary mask**, such that each object will be masked with *B* unique *object_id's* or class labels?

I saw that this can be done by assigning object_id's to videos, but I was wondering if there's a way of doing this for images.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.