-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.py
More file actions
25 lines (19 loc) · 737 Bytes
/
model.py
File metadata and controls
25 lines (19 loc) · 737 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
import torch
from uniformer import Encoder
from segformer_head import Decoder_3d
from base_model import BaseModel
from AttentionModule import AND
class TruVIL(BaseModel):
def __init__(self):
super(TruVIL, self).__init__()
self.in_channels = [64, 128, 320, 512, 512]
self.channels = 768
self.in_index = [0, 1, 2, 3, 4]
self.encoder = Encoder()
self.decoder = Decoder_3d(channels=self.channels, in_channels=self.in_channels, in_index=self.in_index)
self.AND = AND(in_channels=3, out_channels=1)
def forward(self, inputs):
x, x_res1 = self.encoder(inputs)
x = self.decoder(x)
out = self.AND(x_res1, x)
return out