SysCV / sam-pt

SAM-PT: Extending SAM to zero-shot video segmentation with point-based tracking.
https://arxiv.org/abs/2307.01197
Apache License 2.0
950 stars 60 forks source link

How to use mask sampling for tracing? #17

Closed Bentonmaster closed 3 months ago

Bentonmaster commented 11 months ago

我阅读了你们的论文,其中提到了通过提供初始帧掩码的方式进行采样,然后进行跟踪的方法。我想要知道你们提供了相关的测试代码吗?如果有提供就太好了 I read your paper which mentions a method of sampling by providing an initial frame mask and then tracking it. I would like to know if you have provided any test code for this? It would be great if you do.

m43 commented 11 months ago

Hej, thanks for your interest. If you are looking for the point method used to sample points from the mask, it is implemented in the extract_kmedoid_points function. If you are looking for the Video Object Segmentation (VOS) code where an initial GT mask is given and tracked throughout the video, then you can look into the documentation on running the VOS experiments or look directly into the VOS evaluation script. Have I understood your question correctly? Let me know if I can provide further help!

ManuBN786 commented 9 months ago

extract_kmedoid_points only gives you the +ve points.

How to get the -ve points using the same algorithm ?

m43 commented 9 months ago

Hi @ManuBN786, the function extract_kmedoid_points also supports sampling negative points when given the inverted mask as input. For example, if the mask is a float tensor, then you invert it with 1 - mask. For more context, check how we extract the negative points here. In our experiments, I've always used Mixed Sampling for selecting negative points.