-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.py
More file actions
20 lines (18 loc) · 698 Bytes
/
Copy pathMain.py
File metadata and controls
20 lines (18 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
import tifffile
from functions import unet_model_3d, data_gen
if __name__ == "__main__":
image = tifffile.imread('traindata/training_input.tif')
label = tifffile.imread('traindata/training_groundtruth.tif')
res = 48 # 8*n
window_size = (res, res, res)
input_data = data_gen(image, window_size)
label_data = data_gen(label, window_size)
print('image size:', image.shape)
print('data size:', input_data.shape)
model = unet_model_3d((1,) + window_size)
model.summary()
batch_size = 8
no_epochs = 10
model.fit(input_data, label_data, batch_size=batch_size, epochs=no_epochs, verbose=1)
model.save_weights('./3d_unet.h5')