forked from EncoraDigital/SAB-cnn-audio-denoiser
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
41 lines (33 loc) · 1.05 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
import argparse
def _main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
'--mode',
help='Mode for procedure of ML model',
required=False,
default='train')
parser.add_argument(
'--config',
help='Configuration for ML model',
required=False,
default="./conf/config.yaml")
parser.add_argument(
'--gpusize',
help='Mode for procedure of ML model',
required=False,
default=768)
args = parser.parse_args()
args.gpusize = int(args.gpusize)
if args.mode == "preprocess":
from src.create_dataset import main
elif args.mode == "train":
from src.train import main
elif args.mode == "inference":
from src.inference import main
elif args.mode == "tflite":
from src.convert_tflite import main
else:
raise ValueError(f"Mode is validable (preprocess, train, inference, tflite)")
main(args.gpusize, args.config)
if __name__ == "__main__":
_main()