torchvision/datasets/phototour.py
def read_matches_files(data_dir, matches_file):
    """Return a Tensor containing the ground truth matches
       Read the file and keep only 3D point ID.
       Matches are represented with a 1, non matches with a 0.
    """
    matches = []
    with open(os.path.join(data_dir, matches_file), 'r') as f:
        for line in f:
            line_split = line.split()
            matches.append([int(line_split[0]), int(line_split[3]),
                            int(line_split[1] == line_split[4])])
    return torch.LongTensor(matches)
def read_matches_files(data_dir, matches_file):
    matches = []
    with open(os.path.join(data_dir, matches_file), 'r') as f:
        for line in f:
            line_split = line.split()
            matches.append([int(line_split[0]), int(line_split[3]),
                            int(line_split[1] == line_split[4])])
    return torch.LongTensor(matches)
def read_matches_files ( data_dir , matches_file ) : matches = [ ] with open ( os . path . join ( data_dir , matches_file ) , 'r' ) as f : for line in f : line_split = line . split ( ) matches . append ( [ int ( line_split [ 0 ] ) , int ( line_split [ 3 ] ) , int ( line_split [ 1 ] == line_split [ 4 ] ) ] ) return torch . LongTensor ( matches )
Return a Tensor containing the ground truth matches
       Read the file and keep only 3D point ID.
       Matches are represented with a 1, non matches with a 0.
Return a Tensor containing the ground truth matches Read the file and keep only 3D point ID . Matches are represented with a 1 non matches with a 0 .