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

这里为什么要+1呢? #24

Open
lfydegithub opened this issue Dec 21, 2020 · 1 comment
Open

这里为什么要+1呢? #24

lfydegithub opened this issue Dec 21, 2020 · 1 comment

Comments

@lfydegithub
Copy link

assigned_gt_inds[pos_inds] = argmax_overlaps[pos_inds] + 1 # 正样本anchor,保存对应的gt bbox索引,表示和其匹配上

这里为什么要+1呢? 我理解argmax_overlaps里存储了max_overlaps所对应的gt_box的idx, 直接赋值不就好了吗, +1是出于什么考虑呢? 而且在同文件的161~162行进行分配label的时候又去-1已获得gt_box idx, 感觉有点多此一举啊, 但感觉肯定不是没有原因的,所以想问下

            if pos_inds.numel() > 0:
                assigned_labels[pos_inds] = gt_labels[
                    assigned_gt_inds[pos_inds] - 1]  # 正样本anchor处的label值
@xzjzsa
Copy link

xzjzsa commented May 26, 2021

可能是由于负样本对应的gt_box设置为0,无效样本设置为-1,正样本设置为gt_box的idx,为了不与负样本设置的0冲突,所以正样本idx+1,不从0开始。

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

2 participants