yxgeee / OpenIBL

[ECCV-2020 (spotlight)] Self-supervising Fine-grained Region Similarities for Large-scale Image Localization. 🌏 PyTorch open-source toolbox for image-based localization (place recognition).
https://yxgeee.github.io/projects/sfrs
MIT License
271 stars 41 forks source link

About negative samples #17

Open MedlarTea opened 3 years ago

MedlarTea commented 3 years ago

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 commented 3 years ago

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

MedlarTea commented 3 years ago

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 commented 3 years ago

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.