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

Computing confidence mask #22

Closed
alexandru-dinu opened this issue Jun 6, 2018 · 3 comments
Closed

Computing confidence mask #22

alexandru-dinu opened this issue Jun 6, 2018 · 3 comments

Comments

@alexandru-dinu
Copy link

alexandru-dinu commented Jun 6, 2018

In build_targets function, at the beginning, there's a part that calculates the confidence mask tensor.
Initially it is set to a tensor of ones, but the update rule:

    # Objects with higher confidence than threshold are set to zero
    conf_mask[b][cur_ious.view_as(conf_mask[b]) > ignore_thres] = 0

doesn't make sense to me. This basically ignores any ious better than ignore_thres (currently set to 0.5).

I'd think that:

  • either start with a tensor of zeros and use the update rule:
    conf_mask[b][cur_ious.view_as(conf_mask[b]) > thres] = 1
  • either change the sign: conf_mask[b][cur_ious.view_as(conf_mask[b]) <= thres] = 0

Thanks

@ludovic-carre
Copy link

I found the part you are refering to in the commit history but I am not sure why this filtering was removed. Can you explain @eriklindernoren ?

@alexandru-dinu
Copy link
Author

alexandru-dinu commented Jun 11, 2018

I guess because it was redundant / wrong. The mask is computed as:
mask[b, best_anchor_idx, gj, gi] = 1, basically saying that for batch b, the anchor best_anchor_idx of cell (gj, gi) is responsible for predicting some ground truth object.

@eriklindernoren
Copy link
Owner

eriklindernoren commented Jun 17, 2018

This should be fixed in 959e0ff. Before this commit the confidence mask was computed as in YOLOv2. With the latest commit the confidence mask is set as in version 3, i.e. where the anchor has an overlap with a target box larger than 0.5 but is not the anchor with the largest overlap the confidence prediction is ignored during training.

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