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

About negative samples #17

Open
MedlarTea opened this issue Mar 13, 2021 · 3 comments
Open

About negative samples #17

MedlarTea opened this issue Mar 13, 2021 · 3 comments

Comments

@MedlarTea
Copy link

Hi, I have some doubts aoubt the line 84 of ibl/utils/data/dataset.py
self.train_neg = [self.train_neg[idx] for idx in select]
I don't know the effect of this line, maybe it can't help to produce the negative samples outside 25m.
Maybe it should be deleted?

@yxgeee
Copy link
Owner

yxgeee commented Mar 13, 2021

It actually produces the sample inside 25m and is used for evaluation. It cannot be deleted.

@MedlarTea
Copy link
Author

I mean the negative samples for training.
Here:
83: self.train_pos, self.train_neg, select = get_groundtruth(self.q_train, self.db_train, self.intra_thres, self.inter_thres)
84: self.train_neg = [self.train_neg[idx] for idx in select]
85: self.q_train = [self.q_train[idx] for idx in select]

the select is the positive samples in 10m, then you choose the negative samples from it. I thought it's unreasonable.

@yxgeee
Copy link
Owner

yxgeee commented Mar 13, 2021

First, as I remember, select here does not store the positive samples inside 10m, instead, it is just used for sampling valid query images.

Second, train_neg stores the images inside 25m of each anchor, and 25m is the distance for standard evaluation, following NetVLAD, SARE, etc. So why not storing images outside 25m. Since there are plenty of images outside 25m, which is hard to store in the memory. Storing images inside 25m would be much efficient. And we can also easily figure out the negative images (outside 25m) using the stored list.

Third, when you think any variables or codes may be redundant, just delete them and see what will happen. Then you will know what they are used for.

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

2 participants