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

Refreshing template in Vit (Question) #228

Open
arielkantorovich opened this issue Jan 8, 2024 · 4 comments
Open

Refreshing template in Vit (Question) #228

arielkantorovich opened this issue Jan 8, 2024 · 4 comments
Assignees
Labels
question It is not an issue but rather a user question

Comments

@arielkantorovich
Copy link

Hi,
I want to ask you about template refreshing in VitTracker.
I see in Python code the method self. model. update(image) it looks like there is no update template (always first template), On the other hand, I see when I run some video examples that the tracker "Jump" to another object that is different from the original template and continues with this object.
So there is some template udate logic that you implement in your code?
and if Yes how I can control this updated template?

@fengyuentau
Copy link
Member

You can try to call self.model.init again with tracking results to set template.

@fengyuentau fengyuentau self-assigned this Jan 9, 2024
@fengyuentau fengyuentau added the question It is not an issue but rather a user question label Jan 9, 2024
@arielkantorovich
Copy link
Author

Thank you for your comment, So if I understand from your answer there is no template refreshing that you do in the code? (I can do this manually using init method)
When I look at the documentation of Vit in OpenCV, for example, I see that the update method gets to frame and cv::Rect bb so what is the difference? in cpp you update the bb with the method or only use the init bb?

@fengyuentau
Copy link
Member

there is no template refreshing

If init() does not count, yes.

so what is the difference? in cpp you update the bb with the method or only use the init bb?

I do not get your question well but if I am not mis-understanding, you are asking the meaning of the second parameter in update(frame, bbox), right? It serves as the return output. See code here for more details:

https://github.com/opencv/opencv/blob/43c1c81c8c70955e3059637a7f0a099ccd2533b4/modules/video/src/tracking/tracker_vit.cpp#L170-L203

Note that although the template is not refreshed in update() but the target bbox does get updated (see line 200).

@fengyuentau
Copy link
Member

You may try refreshing template to see whether you get a better tracking result that does not make the jump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question It is not an issue but rather a user question
Projects
None yet
Development

No branches or pull requests

2 participants