-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·45 lines (44 loc) · 1.59 KB
/
main.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
33
34
35
36
37
38
39
40
41
42
43
44
45
# coding:utf-8
import dataset_split
import file_fix
import from_csv
from dataset_augment import dataset_augment
if __name__ == '__main__':
print('Please choose an operation\r\n'
'[C]FH image download according to the csv file.\r\n'
'[G]BIF image download according to the csv file.\r\n'
'[U]pdate csv file with the number of images.\r\n'
'[A]ugment data.\r\n'
'[T]rain the model.\r\n'
'[M]ove files according to the csv file.\r\n'
'[F]ix file name illegal character.\r\n'
'[R]emove empty files.\r\n'
'[B]ig files resize.\r\n'
'[S]plit dataset.\r\n'
'E[X]IT.')
while True:
user_input = input('Press enter to end input: ')
if user_input == 'C':
from_csv.from_csv_in_cfh('labels.csv')
elif user_input == 'G':
from_csv.from_csv_in_gbif('birds.csv')
elif user_input == 'U':
from_csv.update_csv('birds.csv', 'birdsnew_csv.csv')
elif user_input == 'T':
print('not supported yet.')
elif user_input == 'X':
break
elif user_input == 'M':
from_csv.from_csv_move_file('mv_files.csv')
elif user_input == 'R':
file_fix.empty_file()
elif user_input == 'F':
file_fix.filename()
elif user_input == 'S':
dataset_split.split()
elif user_input == 'A':
dataset_augment("./data/train/")
elif user_input == 'B':
file_fix.resize_images('./data', 1200)
else:
print('Illegal input.')