polyvore_outfits.py
def parse_iminfo(question, im2index, id2im, gt = None):
    """ Maps the questions from the FITB and compatibility tasks back to
        their index in the precomputed matrix of features

        question: List of images to measure compatibility between
        im2index: Dictionary mapping an image name to its location in a
                  precomputed matrix of features
        gt: optional, the ground truth outfit set this item belongs to
    """
    questions = []
    is_correct = np.zeros(len(question), np.bool)
    for index, im_id in enumerate(question):
        set_id = im_id.split('_')[0]
        if gt is None:
            gt = set_id

        im = id2im[im_id]
        questions.append((im2index[im], im))
        is_correct[index] = set_id == gt

    return questions, is_correct, gt
 Maps the questions from the FITB and compatibility tasks back to
        their index in the precomputed matrix of features

        question: List of images to measure compatibility between
        im2index: Dictionary mapping an image name to its location in a
                  precomputed matrix of features
        gt: optional, the ground truth outfit set this item belongs to
    
Maps the questions from the FITB and compatibility tasks back to
their index in the precomputed matrix of features

List of images to measure compatibility between
im2index: Dictionary mapping an image name to its location in a
precomputed matrix of features
gt: optional, the ground truth outfit set this item belongs to
Maps the questions from the FITB and compatibility tasks back to their index in the precomputed matrix of features List of images to measure compatibility between im2index : Dictionary mapping an image name to its location in a precomputed matrix of features gt : optional the ground truth outfit set this item belongs to
def parse_iminfo(question, im2index, id2im, gt = None):
    questions = []
    is_correct = np.zeros(len(question), np.bool)
    for index, im_id in enumerate(question):
        set_id = im_id.split('_')[0]
        if gt is None:
            gt = set_id
        im = id2im[im_id]
        questions.append((im2index[im], im))
        is_correct[index] = set_id == gt
    return questions, is_correct, gt
def parse_iminfo ( question , im2index , id2im , gt = None ) : questions = [ ] is_correct = np . zeros ( len ( question ) , np . bool ) for index , im_id in enumerate ( question ) : set_id = im_id . split ( '_' ) [ 0 ] if gt is None : gt = set_id im = id2im [ im_id ] questions . append ( ( im2index [ im ] , im ) ) is_correct [ index ] = set_id == gt return questions , is_correct , gt
Maps the questions from the FITB and compatibility tasks back to
their index in the precomputed matrix of features
Maps the questions from the FITB and compatibility tasks back to their index in the precomputed matrix of features
""" Maps the questions from the FITB and compatibility tasks back to
        their index in the precomputed matrix of features

        question: List of images to measure compatibility between
        im2index: Dictionary mapping an image name to its location in a
                  precomputed matrix of features
        gt: optional, the ground truth outfit set this item belongs to
    """
question
im2index
id2im
gt