コード例 #1
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(128, 128, 1)):

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method='whole_image',
                            num_semantic_heads=3,
                            num_semantic_classes=[1, 1, 2],
                            location=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='50614f04d5dbc4b3eadd897fa5fb0e23'
            )

            model.load_weights(weights_path)
        else:
            weights_path = None

        super(CytoplasmSegmentation, self).__init__(model,
                                                    model_image_shape=model_image_shape,
                                                    model_mpp=0.65,
                                                    preprocessing_fn=phase_preprocess,
                                                    postprocessing_fn=deep_watershed,
                                                    dataset_metadata=self.dataset_metadata,
                                                    model_metadata=self.model_metadata)
コード例 #2
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(256, 256, 2)):

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method=None,
                            num_semantic_heads=4,
                            num_semantic_classes=[1, 1, 2, 3],
                            location=True,
                            include_top=True,
                            use_imagenet=False)

        if use_pretrained_weights:
            weights_path = get_file(
                os.path.basename(WEIGHTS_PATH),
                WEIGHTS_PATH,
                cache_subdir='models',
                md5_hash='66fec859eacc5222b5e7d2baa105f3e3')

            model.load_weights(weights_path)
        else:
            weights_path = None

        super(MultiplexSegmentation,
              self).__init__(model,
                             model_image_shape=model_image_shape,
                             model_mpp=2.0,
                             preprocessing_fn=phase_preprocess,
                             postprocessing_fn=deep_watershed_mibi,
                             dataset_metadata=self.dataset_metadata,
                             model_metadata=self.model_metadata)
コード例 #3
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(128, 128, 1)):

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method='whole_image',
                            num_semantic_heads=2,
                            num_semantic_classes=[1, 1],
                            location=True,
                            include_top=True,
                            lite=True,
                            use_imagenet=use_pretrained_weights,
                            interpolation='bilinear')

        if use_pretrained_weights:
            weights_path = get_file(
                os.path.basename(WEIGHTS_PATH),
                WEIGHTS_PATH,
                cache_subdir='models',
                file_hash='104a7d7884c80c37d2bce6d1c3a17c7a')

            model.load_weights(weights_path, by_name=True)
        else:
            weights_path = None

        super(CytoplasmSegmentation,
              self).__init__(model,
                             model_image_shape=model_image_shape,
                             model_mpp=0.65,
                             preprocessing_fn=phase_preprocess,
                             postprocessing_fn=deep_watershed,
                             dataset_metadata=self.dataset_metadata,
                             model_metadata=self.model_metadata)
コード例 #4
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(128, 128, 1)):

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method='whole_image',
                            num_semantic_heads=2,
                            num_semantic_classes=[1, 1],
                            location=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='42ca0ebe4b7b0f782eaa4733cdddad88'
            )

            model.load_weights(weights_path, by_name=True)
        else:
            weights_path = None

        super(NuclearSegmentation, self).__init__(model,
                                                  model_image_shape=model_image_shape,
                                                  model_mpp=0.65,
                                                  preprocessing_fn=None,
                                                  postprocessing_fn=deep_watershed,
                                                  dataset_metadata=self.dataset_metadata,
                                                  model_metadata=self.model_metadata)
コード例 #5
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(128, 128, 1)):

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method='whole_image',
                            num_semantic_heads=3,
                            num_semantic_classes=[1, 1, 2],
                            location=True,
                            include_top=True)

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

            model.load_weights(weights_path)
        else:
            weights_path = None

        super(NuclearSegmentation,
              self).__init__(model,
                             model_image_shape=model_image_shape,
                             model_mpp=0.65,
                             preprocessing_fn=None,
                             postprocessing_fn=deep_watershed,
                             dataset_metadata=self.dataset_metadata,
                             model_metadata=self.model_metadata)
コード例 #6
0
    def __init__(self,
                 use_pretrained_weights=True,
                 model_image_shape=(256, 256, 2)):

        whole_cell_classes = [1, 1, 2, 3]
        nuclear_classes = [1, 1, 2, 3]
        num_semantic_classes = whole_cell_classes + nuclear_classes
        num_semantic_heads = len(num_semantic_classes)

        model = PanopticNet('resnet50',
                            input_shape=model_image_shape,
                            norm_method=None,
                            num_semantic_heads=num_semantic_heads,
                            num_semantic_classes=num_semantic_classes,
                            location=True,
                            include_top=True,
                            use_imagenet=False)

        if use_pretrained_weights:
            weights_path = get_file(
                os.path.basename(WEIGHTS_PATH),
                WEIGHTS_PATH,
                cache_subdir='models',
                file_hash='ff24e821c6056cf847e58e8e52916814')

            model.load_weights(weights_path)
        else:
            weights_path = None

        super(MultiplexSegmentation,
              self).__init__(model,
                             model_image_shape=model_image_shape,
                             model_mpp=0.5,
                             preprocessing_fn=phase_preprocess,
                             postprocessing_fn=deep_watershed_subcellular,
                             format_model_output_fn=format_output_multiplex,
                             dataset_metadata=self.dataset_metadata,
                             model_metadata=self.model_metadata)