facebookresearch / segment-anything-2

The repository provides code for running inference with the Meta Segment Anything Model 2 (SAM 2), links for downloading the trained model checkpoints, and example notebooks that show how to use the model.
Apache License 2.0
10.76k stars 874 forks source link

Ids of the masks #265

Open MiessiGomes opened 3 weeks ago

MiessiGomes commented 3 weeks ago

I am providing positive click coordinates on the frame. Is there a way to use SAM2 segmentation so that it creates a unique ID for each coordinate? The idea would be to have a counter that tracks how many IDs are in the masks and returns the number of segmented objects. There are thousands of frames, so the object is the same, but its quantity present in the frames varies.