| import json | |
| import random | |
| data_list = [ | |
| 'ade_seg.json', | |
| 'cocostuff_seg.json', | |
| 'mapillary_seg.json', | |
| 'paco_lvis_seg.json', | |
| 'pascal_part_seg.json', | |
| # 'llava_instruct_150k.json' | |
| ] | |
| final_data = [] | |
| ref_data = json.load(open('ref_all.json')) | |
| for d in data_list: | |
| data = json.load(open(d)) | |
| print(d, ' ', len(data)) | |
| final_data+=data | |
| random.shuffle(final_data) | |
| output_data = final_data[:200000] | |
| output_data+=ref_data | |
| print(len(output_data)) | |
| with open('sample_seg_300k.json', 'w') as f: | |
| f.write(json.dumps(output_data, indent=4)) |