Skip to content

Commit

Permalink
FIX: Remoção de camadas de dropout no modelo da VGG divamgupta#3
Browse files Browse the repository at this point in the history
  • Loading branch information
duraes-antonio authored and duraes-antonio committed Nov 12, 2020
1 parent b2b230e commit 108527e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 3 additions & 5 deletions keras_segmentation/models/unet.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ def unet_mini(n_classes, input_height=360, input_width=480):
def _unet(n_classes, encoder, l1_skip_conn=True, input_height=416,
input_width=608, dropout=False):
dropout_value = 0.2
img_input, levels = encoder(input_height=input_height, input_width=input_width)
img_input, levels = encoder(
input_height=input_height, input_width=input_width)
[f1, f2, f3, f4, f5] = levels

o = f4
Expand Down Expand Up @@ -125,10 +126,7 @@ def vgg_unet(
):
def get_vgg(input_height: int, input_width: int, dropout=dropout):
return get_vgg_encoder(dropout=dropout, input_height=input_height, input_width=input_width)
model = _unet(
n_classes, get_vgg, input_height=input_height,
input_width=input_width, dropout=dropout
)
model = _unet(n_classes, get_vgg_encoder, input_height=input_height, input_width=input_width)
model.model_name = "vgg_unet"
return model

Expand Down
2 changes: 0 additions & 2 deletions keras_segmentation/models/vgg16.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def get_vgg_encoder(
elif IMAGE_ORDERING == 'channels_last':
img_input = Input(shape=(input_height, input_width, 3))

if img_input is not None:
img_input = Dropout(0.2)(img_input)
x = Conv2D(64, (3, 3), activation='relu', padding='same',
name='block1_conv1', data_format=IMAGE_ORDERING)(img_input)
x = Conv2D(64, (3, 3), activation='relu', padding='same',
Expand Down

0 comments on commit 108527e

Please sign in to comment.