mirror of
https://github.com/Vision-CAIR/MiniGPT-4.git
synced 2025-04-04 18:10:47 +00:00
14 lines
378 B
Python
14 lines
378 B
Python
import os
|
|
import json
|
|
|
|
|
|
def load_aokvqa(aokvqa_dir, split, version='v1p0'):
|
|
assert split in ['train', 'val', 'test', 'test_w_ans']
|
|
dataset = json.load(open(
|
|
os.path.join(aokvqa_dir, f"aokvqa_{version}_{split}.json")
|
|
))
|
|
return dataset
|
|
|
|
def get_coco_path(split, image_id, coco_dir):
|
|
return os.path.join(coco_dir, f"{split}2017", f"{image_id:012}.jpg")
|