-
Notifications
You must be signed in to change notification settings - Fork 0
/
models.py
72 lines (66 loc) · 1.66 KB
/
models.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
from monai.networks.nets import UNet, UNETR
from monai.networks.layers import Norm
def unet64(num_classes=6):
return UNet(
spatial_dims=3,
in_channels=1,
out_channels=num_classes,
channels=(4, 8, 16, 32, 64),
strides=(2, 2, 2, 2),
num_res_units=2,
norm=Norm.BATCH,
)
def unet128(num_classes=6):
return UNet(
spatial_dims=3,
in_channels=1,
out_channels=num_classes,
channels=(8, 16, 32, 64, 128),
strides=(2, 2, 2, 2),
num_res_units=2,
norm=Norm.BATCH,
)
def unet256(num_classes=6):
return UNet(
spatial_dims=3,
in_channels=1,
out_channels=num_classes,
channels=(16, 32, 64, 128, 256),
strides=(2, 2, 2, 2),
num_res_units=2,
norm=Norm.BATCH,
)
def unet512(num_classes=6):
return UNet(
spatial_dims=3,
in_channels=1,
out_channels=num_classes,
channels=(32, 64, 128, 256, 512),
strides=(2, 2, 2, 2),
num_res_units=2,
norm=Norm.BATCH,
)
def unet1024(num_classes=6):
return UNet(
spatial_dims=3,
in_channels=1,
out_channels=num_classes,
channels=(64, 128, 256, 512, 1024),
strides=(2, 2, 2, 2),
num_res_units=4,
norm=Norm.BATCH,
)
def unetr16(num_classes=6):
return UNETR(
in_channels=1,
out_channels=num_classes,
img_size=(96, 96, 96),
feature_size=16,
hidden_size=768,
mlp_dim=3072,
num_heads=12,
pos_embed="perceptron",
norm_name="instance",
res_block=True,
dropout_rate=0.0,
)