-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
30 lines (24 loc) · 700 Bytes
/
Copy pathmain.py
File metadata and controls
30 lines (24 loc) · 700 Bytes
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
import sys
from src.train import train
from src.test import test
from src.utils.config import VERSION
if __name__ == "__main__":
mode = sys.argv[1] if sys.argv[1] == "test" else "train"
is_new = sys.argv[2] if sys.argv[2] == "False" else "True"
if is_new == "True":
with open("data/version", "w") as f:
f.write(str(int(VERSION) + 1))
print(f"Running in {mode}")
if mode == "train":
train()
print("Training model...")
elif mode == "test":
test()
else:
print("Invalid mode. Use 'train' or 'test'.")
"""
python main.py train UNet
python main.py test UNet
python main.py train ResUNet
python main.py test ResUNet
"""