Skip to content

Commit

Permalink
Chose best ultralytics#19 version
Browse files Browse the repository at this point in the history
  • Loading branch information
manole-alexandru committed Apr 22, 2023
1 parent 3ad56ff commit b004153
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions models/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,20 +850,24 @@ def forward(self, x):
class Seg(nn.Module):

def __init__(self, in_channels):

super().__init__()
self.cv1 = Conv(in_channels, 96, k=3)
self.cv1 = Conv(in_channels, 32, k=3)
self.cv11 = Conv(96, 32, k=3)

self.upsample = nn.Upsample(scale_factor=2, mode='nearest')
self.cv2 = Conv(192, 48, k=3)
self.cv3 = Conv(48, 16, k=3)
self.cv2 = Conv(64, 32, k=3)
self.cv3 = Conv(32, 16, k=3)
self.cv4 = Conv(16, 1, act=False)
self.relu = nn.ReLU()

self.dropout_normal = nn.Dropout(0.5)

def forward(self, x, skipped_input):

x = self.cv1(x)
x = self.upsample(x)
x = torch.cat((x, skipped_input[0]), 1) # Skip connection
x2 = self.cv11(skipped_input[0])
x = torch.cat((x, x2), 1) # Skip connection

x = self.cv2(x)
x = self.upsample(x)
Expand Down

0 comments on commit b004153

Please sign in to comment.