Beispiel #1
0
        -o[utput]: Output folder of the rendered results
        -k: Render top-K answers (default 1)
        -p[icture]: Picture folder, only required in LaTeX mode (default "img")
        -r[esults]: Results folder where trained models are stored (default "../results")
        -f[ile]: Output filename, only required in LaTex mode
        -dataset: Use DAQUAR/COCO-QA dataset (default "cocoqa")
        -format: Set output format to HTML/LaTeX (default "html")

    Input question list format:
        QID1,Question1,GroundTruthAnswer1
        QID2,Question2,GroundTruthAnswer2
        ...
    """
    params = ir.parseComparativeParams(sys.argv)

    urlDict = ir.loadImgUrl(params['dataset'], params['dataFolder'])
    data = it.loadDataset(params['dataFolder'])
    maxlen = data['testData'][0].shape[1]

    print('Parsing input file...')
    caption, qids, questions, answers = parseInputFile(params['inputFile'])
    idx = np.array(qids, dtype='int')
    #inputTestSel = data['testData'][0][idx]
    #targetTestSel = data['testData'][1][idx]
    imgids = qids
    #imgids = inputTestSel[:, 0, 0]
    inputTest = prep.combine(\
        prep.lookupQID(questions, data['questionDict'], maxlen), imgids)
    targetTest = prep.lookupAnsID(answers, data['ansDict'])
    questionTypeArray = data['questionTypeArray'][idx]