build_graph/localization_network/dataset.py [211:229]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.pdist = {}
        self.pdist['homography'] = self.parse_pdist(pdist_fl = f'{self.retr_dir}/{self.split}_homography_inliers.pth',
                                                    keep_fn = lambda mat: (mat>self.min_inliers))
        self.pdist['r152'] = self.parse_pdist(pdist_fl = f'{self.retr_dir}/{self.split}_pdist_r152_samek.pth',
                                              keep_fn = lambda mat: (mat==mat))

        self.data = [entry for entry in self.data if entry['uid'] in self.pdist['homography']['domain']]
        print (f'Keeping {len(self.data)} entries in {self.split}')

    def select_positive(self, index):
        p = [0.5, 0.5]
        opt = self.rs.choice([0, 1], p=p)
        if opt==0:
            frameB, src = self.same_interaction(index)
        elif opt==1:
            frameB, src = self.sim_homography(index, self.pdist['homography'], self.min_inliers)
        return frameB, src

    def select_negative(self, index):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



build_graph/localization_network/dataset.py [257:274]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.pdist = {}
        self.pdist['homography'] = self.parse_pdist(pdist_fl = f'{self.retr_dir}/{self.split}_homography_inliers.pth',
                                                    keep_fn = lambda mat: (mat>self.min_inliers))
        self.pdist['r152'] = self.parse_pdist(pdist_fl = f'{self.retr_dir}/{self.split}_pdist_r152_samek.pth',
                                              keep_fn = lambda mat: (mat==mat))
        self.data = [entry for entry in self.data if entry['uid'] in self.pdist['homography']['domain']]
        print (f'Keeping {len(self.data)} entries in {self.split}')

    def select_positive(self, index):
        p = [0.5, 0.5]
        opt = self.rs.choice([0, 1], p=p)
        if opt==0:
            frameB, src = self.same_interaction(index)
        elif opt==1:
            frameB, src = self.sim_homography(index, self.pdist['homography'], self.min_inliers)
        return frameB, src

    def select_negative(self, index):
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



