Download lisa_data/sample.py from Lillyr/seg: direct link, hf CLI and curl.
- Browser
- Download file 564 Bytes
-
https://huggingface.co/datasets/Lillyr/seg/resolve/main/lisa_data/sample.py
- Command line
-
hf download hf://datasets/Lillyr/seg/lisa_data/sample.py
-
curl -L -o sample.py https://huggingface.co/datasets/Lillyr/seg/resolve/main/lisa_data/sample.py
564 Bytes
| 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)) |