forked from UESTC-Ingress/IFSolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.py
33 lines (30 loc) · 1.05 KB
/
clean.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import shutil
import glob
import os
import shutil
def main():
if input('Do you want to clean generated data? (y/n)') == 'y':
if os.path.isdir('cmp'):
shutil.rmtree('cmp')
if os.path.exists('result_pre.jpg'):
os.remove('result_pre.jpg')
if os.path.exists('split.json'):
os.remove('split.json')
if os.path.exists('result.jpg'):
os.remove('result.jpg')
if os.path.exists('result_full.jpg'):
os.remove('result_full.jpg')
if os.path.exists('result.json'):
os.remove('result.json')
fileList = glob.glob('result_*.jpg')
for filePath in fileList:
os.remove(filePath)
if input('Do you want to clean portals dataset? (y/n)') == 'y':
if os.path.isdir('data'):
shutil.rmtree('data')
if os.path.isdir('data_feature'):
shutil.rmtree('data_feature')
if os.path.isdir('data_feature_preview'):
shutil.rmtree('data_feature_preview')
if __name__ == "__main__":
main()