patrick-tssn / Streaming-Grounded-SAM-2

Grounded Tracking for Streaming Videos
Apache License 2.0
25 stars 2 forks source link

Detect new object and Keep tracking of old obejcts #2

Open Riser6 opened 3 weeks ago

Riser6 commented 3 weeks ago

Hi, Thanks for this very wonderful and useful project. I wondered if it would be possible to accept streaming video as input, constantly detect new objects and track them, while keeping track of old ones (even if they disappear for a while due to occlusion). Thanks in advance!

patrick-tssn commented 3 weeks ago

For SAM2, it depends on the length of the FIFO queue. For Grounded-SAM2, you can preserve the text of the old object as the input for GroundingDINO. Unfortunately, this code hasn't been tested with multiple reference objects.

Riser6 commented 3 weeks ago

For SAM2, it depends on the length of the FIFO queue. For Grounded-SAM2, you can preserve the text of the old object as the input for GroundingDINO. Unfortunately, this code hasn't been tested with multiple reference objects.

Thanks for your reply. But when data is streamed in and new objects need to be constantly detected, I'm still not sure can SAM2 get a consistent instance id for the same object, even if it disappears for a while and reappears.

patrick-tssn commented 2 weeks ago

Apologies for the late reply. I believe it is possible as long as the object remains within the FIFO queue.