vqa_data_provider_layer.py 文件源码

python
阅读 46 收藏 0 点赞 0 评论 0

项目:vqa-mcb 作者: akirafukui 项目源码 文件源码
def load_genome_json():
        """
        Parses the genome json file. Returns the question dictionary and the
        answer dictionary.
        """
        qdic, adic = {}, {}

        with open(config.DATA_PATHS['genome']['genome_file'], 'r') as f:
            qdata = json.load(f)
            for q in qdata:
                key = 'genome' + QID_KEY_SEPARATOR + str(q['id'])
                qdic[key] = {'qstr': q['question'], 'iid': q['image']}
                adic[key] = [{'answer': q['answer']}]

        print 'parsed', len(qdic), 'questions for genome'
        return qdic, adic
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号