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

anchor question #129

Closed
Programmerwyl opened this issue Jul 24, 2019 · 9 comments
Closed

anchor question #129

Programmerwyl opened this issue Jul 24, 2019 · 9 comments

Comments

@Programmerwyl
Copy link

1.I want to know whether anchor is generated based on the size of the feature diagram or the original diagram?
2.There is only one anchor scale, which can do things because the shape of the object tracked will not change greatly,However, does this kind of sample limit the size of tracking objects? For too large and too small objects, the effect is relatively poor.
Thanks

@ZhiyuanChen
Copy link
Collaborator

  1. feature diagram
  2. no. it will perform well on too small objects, and probably better on too large objects. it only limits the ability to track an object which changes from too small to too large in a few frames, which isn't something we focus.

@ZhiyuanChen ZhiyuanChen self-assigned this Dec 27, 2019
@Programmerwyl
Copy link
Author

Hi yc-zc:
1.Thank you very much for your reply.
2.Does this mean that the anchors change according to the size of the object to be tracked.
That means whether the object being tracked is too large or too small,the anchor will adapt itself?
that is great.
thank you very much

@ZhiyuanChen
Copy link
Collaborator

ZhiyuanChen commented Dec 30, 2019

Hi yc-zc:
1.Thank you very much for your reply.
2.Does this mean that the anchors change according to the size of the object to be tracked.
That means whether the object being tracked is too large or too small,the anchor will adapt itself?
that is great.
thank you very much

No worries, glad I can help.
The scale of anchors is fixed, which means the size of anchors will not change, since there is an assumption that "the target’s scale won’t change much in two adjacent frames". However, the scale of proposals will change based on the output of the regression branch of rpn, where the w and h represents the change in x and y direction.

@Programmerwyl
Copy link
Author

Programmerwyl commented Dec 31, 2019

Hi yc_zc:
what does 'the scale of proposals' refer to?
it is delta?

  def _convert_bbox(self, delta, anchor):
        delta = delta.permute(1, 2, 3, 0).contiguous().view(4, -1)
        delta = delta.data.cpu().numpy()
        delta[0, :] = delta[0, :] * anchor[:, 2] + anchor[:, 0]
        delta[1, :] = delta[1, :] * anchor[:, 3] + anchor[:, 1]
        delta[2, :] = np.exp(delta[2, :]) * anchor[:, 2]
        delta[3, :] = np.exp(delta[3, :]) * anchor[:, 3]
        return delta

looking forward to your reply,Thank you very much.

@ZhiyuanChen
Copy link
Collaborator

Hi yc_zc:
what does 'the scale of proposals' refer to?
it is delta?

  def _convert_bbox(self, delta, anchor):
        delta = delta.permute(1, 2, 3, 0).contiguous().view(4, -1)
        delta = delta.data.cpu().numpy()
        delta[0, :] = delta[0, :] * anchor[:, 2] + anchor[:, 0]
        delta[1, :] = delta[1, :] * anchor[:, 3] + anchor[:, 1]
        delta[2, :] = np.exp(delta[2, :]) * anchor[:, 2]
        delta[3, :] = np.exp(delta[3, :]) * anchor[:, 3]
        return delta

looking forward to your reply,Thank you very much.

Happy new year!
The RPN was proposed by Kaiming He et al. in their paper of faster rcnn. As a detection framework, their network needs to detect object in different size, so anchors are generated in different scales and shapes. However, since we assume the object won't change much in size, the scale of anchor is fixed, that is, you cannot find code of scale in this repo.

@Programmerwyl
Copy link
Author

Happy new year!
you are so nice!
I wonder if I can make sense of the fact that the object being detected has to be labeled first,so the scaling can be determined by the size of the object being detected.Since the size of the detected object does not change much in the video,scaling once is sufficient.
thank you very much!

@ZhiyuanChen
Copy link
Collaborator

ZhiyuanChen commented Jan 2, 2020

Happy new year!
you are so nice!
I wonder if I can make sense of the fact that the object being detected has to be labeled first,so the scaling can be determined by the size of the object being detected.Since the size of the detected object does not change much in the video,scaling once is sufficient.
thank you very much!

Happy new year!
Thank you
Yes, for SOT task, we assume the ground truth of template will be provided at the first frame. I suggest you read the paper more carefully, it has detailed explanations on how to do the regressoin of the bounding box.

@Programmerwyl
Copy link
Author

I will read the paper more carefully.
Thank you very much!

@ZhiyuanChen ZhiyuanChen removed their assignment Jan 3, 2020
@qinc
Copy link

qinc commented Feb 25, 2020

Please correct me if I'm wrong for the following observations:

Based on @zyc-ai 's description, and the paper, anchors should be generated based on the size of template bounding box, but in the code, wherever Anchors is generated it was always through code like this:
self.anchors = Anchors(cfg.ANCHOR.STRIDE,
cfg.ANCHOR.RATIOS,
cfg.ANCHOR.SCALES)
which will give anchors with constant size (64x64, before applying ratios). For generating positive classified anchors, one anchor box need to have >0.6 IOU with the ground truth, that means if the ground truth bounding box is much bigger or smaller than 64x64, no anchor will be considered positive during training, and that object won't be detected during tracking at all.

A workaround is to defined multiple anchor scales, but the paper claims only one scale is needed, which is very confusing. This will only happen if all the tracking objects are around the same 64x64 size in the search image.

Am I missing something? Please point out if there is code somewhere I've missed, thanks~!

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

No branches or pull requests

3 participants