IDEA-Research / Grounded-SAM-2

Grounded SAM 2: Ground and Track Anything in Videos with Grounding DINO, Florence-2 and SAM 2
https://arxiv.org/abs/2401.14159
Apache License 2.0
708 stars 51 forks source link

If our video does not initially contain the object we want to detect, how should we modify the code? #45

Open Zhujx-zjjx opened 1 week ago

Zhujx-zjjx commented 1 week ago

As stated in the question, when the object I want to detect does not appear at the beginning of my video, the code will report an error when running. What method should I use to eliminate this hidden danger?

rentainhe commented 1 week ago

As stated in the question, when the object I want to detect does not appear at the beginning of my video, the code will report an error when running. What method should I use to eliminate this hidden danger?

You can set the start frame to 10 or later which may be helpful to avoid this issue. Or you can check each frame to determine a suitable start frame for your demo.

Or you can implement a check function to determine which frame the object first appears in, and then decide whether to start tracking from this frame.

Zhujx-zjjx commented 1 week ago

I agree with your comments. The problem is that designing a check function might be not easy, could you give me some suggestions about this check function?

rentainhe commented 1 week ago

I agree with your comments. The problem is that designing a check function might be not easy, could you give me some suggestions about this check function?

I think you can try this solution:

You can try this solution for your scenarios.

And I think this is a good topic for us to discuss how to use SAM 2 better