Skip to content

Commit

Permalink
en buyuk resnet blogu fpn den cikartildi
Browse files Browse the repository at this point in the history
  • Loading branch information
Samet Hicsonmez committed Jan 15, 2019
1 parent 3498dfa commit 08086b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions models/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,10 +600,10 @@ def __init__(self, C2_size, C3_size, C4_size, C5_size, feature_size=128):
# add P4 elementwise to C3
self.P3_1 = nn.Conv2d(C3_size, feature_size, kernel_size=1, stride=1, padding=0)
self.P3_upsampled = nn.Upsample(scale_factor=2, mode='nearest')
#self.rp3 = nn.ReflectionPad2d(1)
#self.P3_2 = nn.Conv2d(feature_size, feature_size, kernel_size=3, stride=1, padding=0)
self.rp3 = nn.ReflectionPad2d(1)
self.P3_2 = nn.Conv2d(feature_size, feature_size, kernel_size=3, stride=1, padding=0)

self.P2_1 = nn.Conv2d(C2_size, feature_size, kernel_size=1, stride=1, padding=0)
#self.P2_1 = nn.Conv2d(C2_size, feature_size, kernel_size=1, stride=1, padding=0)
self.P2_upsampled = nn.Upsample(scale_factor=2, mode='nearest')
self.rp4 = nn.ReflectionPad2d(1)
self.P2_2 = nn.Conv2d(feature_size, feature_size/2, kernel_size=3, stride=1, padding=0)
Expand All @@ -615,7 +615,7 @@ def __init__(self, C2_size, C3_size, C4_size, C5_size, feature_size=128):

def forward(self, inputs):

C2, C3, C4, C5 = inputs
C3, C4, C5 = inputs

P5_x = self.P5_1(C5)
P5_upsampled_x = self.P5_upsampled(P5_x)
Expand All @@ -631,12 +631,12 @@ def forward(self, inputs):
P3_x = self.P3_1(C3)
P3_x = P3_x + P4_upsampled_x
P3_upsampled_x = self.P3_upsampled(P3_x)
#P3_x = self.rp3(P3_x)
#P3_x = self.P3_2(P3_x)
P3_x = self.rp3(P3_upsampled_x)
P3_x = self.P3_2(P3_x)

P2_x = self.P2_1(C2)
P2_x = P2_x + P3_upsampled_x
P2_upsampled_x = self.P2_upsampled(P2_x)
#P2_x = self.P2_1(C2)
#P2_x = P2_x + P3_upsampled_x
P2_upsampled_x = self.P2_upsampled(P3_x)
P2_x = self.rp4(P2_upsampled_x)
P2_x = self.P2_2(P2_x)

Expand Down Expand Up @@ -760,7 +760,7 @@ def forward(self, inputs):
x3 = self.layer3(x2)
x4 = self.layer4(x3)

out = self.fpn([x1, x2, x3, x4])
out = self.fpn([x2, x3, x4])

out = self.pad3(out)
out = self.conv2(out)
Expand Down
2 changes: 1 addition & 1 deletion options/train_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(self, parser):
parser = BaseOptions.initialize(self, parser)
parser.add_argument('--display_freq', type=int, default=400, help='frequency of showing training results on screen')
parser.add_argument('--display_ncols', type=int, default=4, help='if positive, display all images in a single visdom web panel with certain number of images per row.')
parser.add_argument('--display_id', type=int, default=1, help='window id of the web display')
parser.add_argument('--display_id', type=int, default=0, help='window id of the web display')
parser.add_argument('--display_server', type=str, default="http://localhost", help='visdom server of the web display')
parser.add_argument('--display_env', type=str, default='main', help='visdom display environment name (default is "main")')
parser.add_argument('--display_port', type=int, default=8097, help='visdom port of the web display')
Expand Down

0 comments on commit 08086b4

Please sign in to comment.