Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Zhujx-zjjx opened this issue Sep 5, 2024 · 3 comments

Comments

@Zhujx-zjjx
Copy link

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
Copy link
Collaborator

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
Copy link
Author

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
Copy link
Collaborator

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:

  • Firstly, run grounding model on a set of frames, like frame 1, frame 3, frame 5, and collect all the grounding results of your specific classname
  • Then, you can try to use NMS op to filter objects with large overlap areas
  • Use the grounding boxes as your initial prompt for tracking

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants