dekunma commited on
Commit
a4e1045
·
verified ·
1 Parent(s): d5ed0b0

Upload scripts

Browse files
scripts/extract.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from variables import *
3
+
4
+ if __name__ == '__main__':
5
+ print('Enter the path where you want to store the extracted dataset: (default: ./V2X-Sim-2)', end='')
6
+ extract_to = input()
7
+ if len(extract_to) == 0:
8
+ extract_to = './V2X-Sim-2'
9
+
10
+ os.makedirs(extract_to, exist_ok=True)
11
+ for ii in single_files:
12
+ os.system(f'unzip {ii}.zip -d {extract_to}')
13
+
14
+ for ii in separated_files:
15
+ for jj in range(1, ii[1]+1):
16
+ os.system(f'unzip {ii[0]}{jj}.zip -d {extract_to}')
17
+
scripts/variables.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ single_files = ['bev', 'cam_int', 'gnss', 'imu', 'lidarseg', 'maps', 'seg', 'v2.0']
3
+ separated_files = [
4
+ ['cam_front', 6],
5
+ ['cam_back', 6],
6
+ ['dep_front', 6],
7
+ ['dep_back', 6],
8
+ ['lidar', 3],
9
+ ['cam_int', 2]
10
+ ]
scripts/verify_dataset.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ from variables import *
3
+
4
+ def check_files_exist() -> bool:
5
+ missing_files = []
6
+
7
+ def check_file_missing(file_name):
8
+ file_name += '.zip'
9
+ if not os.path.isfile(file_name):
10
+ missing_files.append(file_name)
11
+
12
+ for ii in (single_files + separated_files):
13
+ if type(ii) == list:
14
+ for jj in range(1, ii[1]+1):
15
+ check_file_missing(f'{ii[0]}{jj}')
16
+ else:
17
+ check_file_missing(ii)
18
+
19
+ if len(missing_files) != 0:
20
+ for ii in missing_files:
21
+ print(f'Error: missing {ii}')
22
+ return False
23
+ return True
24
+
25
+ if __name__ == '__main__':
26
+ print('Verifying all files exist...', end='')
27
+ assert check_files_exist()
28
+ print('success')