QVPR / Patch-NetVLAD

Code for the CVPR2021 paper "Patch-NetVLAD: Multi-Scale Fusion of Locally-Global Descriptors for Place Recognition"
MIT License
510 stars 72 forks source link

Why filter msls for im2im use "idx[len(idx) // 2]" #49

Closed ChengFengGu closed 2 years ago

ChengFengGu commented 2 years ago

During process msls dataset for im2im train task, i know should filter them for this subtask, but why use "idx[len(idx) // 2]"(original code)


    @staticmethod
    def filter(seqKeys, seqIdxs, center_frame_condition): #center_frame_conditions is the frame idxs of origin dataset #TODO, filter in how condition
        keys, idxs = [], []
        for key, idx in zip(seqKeys, seqIdxs):
            if idx[len(idx) // 2] in center_frame_condition: # TODO: why shoud use [len(idx)//2]
                keys.append(key)
                idxs.append(idx)
        return keys, np.asarray(idxs)

What's it physical meaning. Thansks sincerely!

StephenHausler commented 2 years ago

Hi @ChengFengGu, my understanding is that the "idx[len(idx) // 2]" is used for seq2seq VPR tasks, in which case it selects the image id that is at the middle of the sequence. I didn't write this code, msls.py is heavily copied from: https://github.com/mapillary/mapillary_sls

Patch-NetVLAD never uses seq2seq, only the im2im task. The same method works for both im2im and seq2seq tasks, since in the im2im case len(idx) = 1 (idx is always a list even for the im2im task).