-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (31 loc) · 1.41 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
from pipeline import MRIGANPipeline
def parse_args():
parser = argparse.ArgumentParser(description="MRI GAN Training Pipeline")
parser.add_argument('--data_dir_t1', type=str, default="./Tr1/",
help="Path to the T1 MRI dataset directory")
parser.add_argument('--data_dir_t2', type=str, default="./Tr2/",
help="Path to the T2 MRI dataset directory")
parser.add_argument('--img_height', type=int, default=256,
help="Height of the input images")
parser.add_argument('--img_width', type=int, default=256,
help="Width of the input images")
parser.add_argument('--batch_size', type=int, default=16,
help="Batch size for training")
parser.add_argument('--buffer_size', type=int, default=1000,
help="Buffer size for shuffling the dataset")
parser.add_argument('--epochs', type=int, default=125,
help="Number of epochs to train the model")
return parser.parse_args()
if __name__ == "__main__":
args = parse_args()
pipeline = MRIGANPipeline(
data_dir_t1=args.data_dir_t1,
data_dir_t2=args.data_dir_t2,
img_height=args.img_height,
img_width=args.img_width,
batch_size=args.batch_size,
buffer_size=args.buffer_size,
epochs=args.epochs
)
pipeline.train()