Datasets:
Tasks:
Visual Question Answering
Modalities:
Image
Formats:
imagefolder
Languages:
English
Size:
< 1K
License:
Download metadata/data.py from Gumpest/AutoV-data: direct link, hf CLI and curl.
- Browser
- Download file 992 Bytes
-
https://huggingface.co/datasets/Gumpest/AutoV-data/resolve/main/metadata/data.py
- Command line
-
hf download hf://datasets/Gumpest/AutoV-data/metadata/data.py
-
curl -L -o data.py https://huggingface.co/datasets/Gumpest/AutoV-data/resolve/main/metadata/data.py
992 Bytes
| import json | |
| import os | |
| home_dir = '/mnt/bn/bes-mllm-shared/zhangyuan.kevin/LLaVA/playground/data/' | |
| save_dir ='/mnt/bn/bes-mllm-shared/zhangyuan.kevin' | |
| data = json.load(open(os.path.join(home_dir, 'llava_v1_5_mix665k.json'))) | |
| # 0 - 364099 coco: 25K | |
| # 364100 - 450516 vg: 20K | |
| # 450517 - 522656 gqa: 20K | |
| # 522657 - 602656 ocrvqa: 20K | |
| # 602657 - 624610 textvqa: 15K | |
| # 624611 - 649999 caption: None | |
| sample_data = [] | |
| sample_data.extend(data[0:25000]) | |
| sample_data.extend(data[364100:384100]) | |
| sample_data.extend(data[450517:470517]) | |
| sample_data.extend(data[522657:542657]) | |
| sample_data.extend(data[602657:617657]) | |
| print('length of reward dataset is:',len(sample_data)) | |
| filter_sample_data = [] | |
| for item in sample_data: | |
| i = {} | |
| i['conversations'] = item['conversations'][:2] | |
| i['image'] = item['image'] | |
| i['id'] = item['id'] | |
| filter_sample_data.append(i) | |
| with open(os.path.join(save_dir, 'llava_v1_5_mix100k_filter.json'), 'w') as f: | |
| json.dump(filter_sample_data, f, indent=4) |