Lillyr commited on
Commit
9949f61
·
verified ·
1 Parent(s): ce61bb1

upload dataset file to repo

Browse files
Files changed (1) hide show
  1. lisa_data/sample.py +28 -0
lisa_data/sample.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+ import random
3
+
4
+ data_list = [
5
+ 'ade_seg.json',
6
+ 'cocostuff_seg.json',
7
+ 'mapillary_seg.json',
8
+ 'paco_lvis_seg.json',
9
+ 'pascal_part_seg.json',
10
+ # 'llava_instruct_150k.json'
11
+ ]
12
+ final_data = []
13
+
14
+ ref_data = json.load(open('ref_all.json'))
15
+
16
+ for d in data_list:
17
+ data = json.load(open(d))
18
+ print(d, ' ', len(data))
19
+ final_data+=data
20
+
21
+ random.shuffle(final_data)
22
+
23
+ output_data = final_data[:200000]
24
+ output_data+=ref_data
25
+
26
+ print(len(output_data))
27
+ with open('sample_seg_300k.json', 'w') as f:
28
+ f.write(json.dumps(output_data, indent=4))