Skip to content

Commit

Permalink
Merge 001cb0d into b44b680
Browse files Browse the repository at this point in the history
  • Loading branch information
msschwartz21 committed Apr 20, 2020
2 parents b44b680 + 001cb0d commit 9bcde44
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
10 changes: 6 additions & 4 deletions deepcell/applications/cytoplasm_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@


WEIGHTS_PATH = ('https://deepcell-data.s3-us-west-1.amazonaws.com/'
'model-weights/general_cyto_9c7b79e6238d72c14ea8f87023ac3af9.h5')
'model-weights/general_cyto.h5')


class CytoplasmSegmentation(Application):
Expand Down Expand Up @@ -96,7 +96,7 @@ class CytoplasmSegmentation(Application):
#: Metadata for the model and training process
model_metadata = {
'batch_size': 2,
'lr': 1e-5,
'lr': 1e-4,
'lr_decay': 0.95,
'training_seed': 0,
'n_epochs': 8,
Expand All @@ -114,14 +114,16 @@ def __init__(self,
num_semantic_heads=3,
num_semantic_classes=[1, 1, 2],
location=True,
include_top=True)
include_top=True,
lite=True,
interpolation='bilinear')

if use_pretrained_weights:
weights_path = get_file(
os.path.basename(WEIGHTS_PATH),
WEIGHTS_PATH,
cache_subdir='models',
md5_hash='4e9136df5071930a66365b2229fc358b'
md5_hash='50614f04d5dbc4b3eadd897fa5fb0e23'
)

model.load_weights(weights_path)
Expand Down
10 changes: 6 additions & 4 deletions deepcell/applications/nuclear_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@


WEIGHTS_PATH = ('https://deepcell-data.s3-us-west-1.amazonaws.com/'
'model-weights/general_nuclear_train_batch_size_82800_resnet50_'
'8_epochs_c4b2167eb754923856bc84fb29074413.h5')
'model-weights/nuclear_0_82800_resnet50_watershed_'
'076bb10d832089b6a77faed1e63ad375.h5')


class NuclearSegmentation(Application):
Expand Down Expand Up @@ -114,14 +114,16 @@ def __init__(self,
num_semantic_heads=3,
num_semantic_classes=[1, 1, 2],
location=True,
include_top=True)
include_top=True,
lite=True,
interpolation='bilinear')

if use_pretrained_weights:
weights_path = get_file(
os.path.basename(WEIGHTS_PATH),
WEIGHTS_PATH,
cache_subdir='models',
md5_hash='eb29808ef2f662fb3bcda6986e47f91a'
md5_hash='62b6ac21807d34dd42734f43ed20756f'
)

model.load_weights(weights_path)
Expand Down
5 changes: 3 additions & 2 deletions deepcell/model_zoo/fpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,9 @@ def __create_pyramid_features(backbone_dict,
P_minus_1 = Activation('relu', name=N + '_relu')(P_minus_2)

if ndim == 2:
P_minus_1 = Conv2D(feature_size, kernel_size=(3, 3), strides=(2, 2),
padding='same', name=P_minus_1_name)(P_minus_1)
P_minus_1 = Conv2D(feature_size, kernel_size=(3, 3),
strides=(2, 2), padding='same',
name=P_minus_1_name)(P_minus_1)
else:
P_minus_1 = Conv3D(feature_size, kernel_size=(1, 3, 3),
strides=(1, 2, 2), padding='same',
Expand Down
6 changes: 4 additions & 2 deletions deepcell/model_zoo/panopticnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ def PanopticNet(backbone,
pyramid_dict = create_pyramid_features(backbone_dict_reduced,
ndim=ndim,
lite=lite,
upsample_type='upsampling2d')
upsample_type='upsampling2d',
interpolation=interpolation)

features = [pyramid_dict[key] for key in pyramid_levels]

Expand All @@ -414,7 +415,8 @@ def PanopticNet(backbone,
semantic_head_list.append(create_semantic_head(
pyramid_dict, n_classes=num_semantic_classes[i],
input_target=inputs, target_level=target_level,
semantic_id=i, ndim=ndim, **kwargs))
semantic_id=i, ndim=ndim, interpolation=interpolation,
**kwargs))

outputs = semantic_head_list

Expand Down

0 comments on commit 9bcde44

Please sign in to comment.