Exemple #1
0
def run_model_on_dir():
    data_location = os.path.join(DATA_DIR, PREFIX, 'set1')
    output_location = os.path.join(RESULTS_DIR, PREFIX)
    channel_names = ['phase']
    image_size_x, image_size_y = get_image_sizes(data_location, channel_names)

    model_name = '2018-06-13_ecoli_kc_polaris_channels_last_sample__0.h5'
    weights = os.path.join(MODEL_DIR, PREFIX, model_name)

    n_features = 3
    window_size = (30, 30)

    model_fn = bn_feature_net_61x61 if DATA_OUTPUT_MODE == 'sample' else bn_dense_feature_net

    predictions = run_models_on_directory(data_location=data_location,
                                          channel_names=channel_names,
                                          output_location=output_location,
                                          n_features=n_features,
                                          model_fn=model_fn,
                                          list_of_weights=[weights],
                                          image_size_x=image_size_x,
                                          image_size_y=image_size_y,
                                          win_x=window_size[0],
                                          win_y=window_size[1],
                                          split=False)
nuclear_location = os.path.join(direc_name, 'Nuclear2')
mask_location = os.path.join(direc_name, 'Masks')

cyto_channel_names = ["Phase", "Far-red"]
nuclear_channel_names = ['Far-red']

trained_network_cyto_directory = "/home/vanvalen/DeepCell/trained_networks/HeLa/"
trained_network_nuclear_directory = "/home/vanvalen/DeepCell/trained_networks/Nuclear/"

cyto_prefix = "2017-12-03_HeLa_joint_disc_same_61x61_bn_dense_feature_net_"
nuclear_prefix = "2016-07-12_nuclei_all_61x61_bn_feature_net_61x61_"

win_cyto = 30
win_nuclear = 30

image_size_x, image_size_y = get_image_sizes(data_location, cyto_channel_names)
# image_size_x += 2*win_cyto
# image_size_y += 2*win_cyto

"""
Define model
"""

list_of_cyto_weights = []
for j in xrange(1):
	cyto_weights = os.path.join(trained_network_cyto_directory,  cyto_prefix + str(j) + ".h5")
	list_of_cyto_weights += [cyto_weights]

# list_of_nuclear_weights = []
# for j in xrange(1):
# 	nuclear_weights = os.path.join(trained_network_nuclear_directory,  nuclear_prefix + str(j) + ".h5")
Exemple #3
0
"""

direc_name = '/data/testing_data/nuclei_broad/set1'
data_location = os.path.join(direc_name, 'RawImages')
nuclear_location = os.path.join(direc_name, 'Nuclear')
mask_location = os.path.join(direc_name, 'Masks')

nuclear_channel_names = ['nuclear']

trained_network_nuclear_directory = "/data/trained_networks/nuclei_broad/"

nuclear_prefix = "2018-01-20_nuclei_broad_same_conv_61x61_bn_dense_feature_net_"

win_nuclear = 30

image_size_x, image_size_y = get_image_sizes(data_location, nuclear_channel_names)

"""
Define model
"""

list_of_nuclear_weights = []
for j in xrange(1):
	nuclear_weights = os.path.join(trained_network_nuclear_directory,  nuclear_prefix + str(j) + ".h5")
	list_of_nuclear_weights += [nuclear_weights]

print list_of_nuclear_weights

"""
Run model on directory
"""