Skip to content

FeatureExtractor

FeatureExtractor class

dlf.models.feature_extractor.FeatureExtractor(
    model_name, input_shape, weights="imagenet", last_layer=None, freeze=False, **kwargs
)

Feature Extractor

This implementation allows it to initialize pre-trained Keras models for the usage as feature extractor.

Aliases

  • feature_extractor
  • FeatureExtractor

Arguments

  • model_name: str. Name of the model e.g. ResNet50
  • input_shape: tuple. Tuple containing the dimension of the input
  • weights: str. path to weights or just 'imagenet'. Defaults to 'imagenet'.
  • freeze: bool. If false the feature extractor is not trainable. Defaults to False.
  • last_layer: str. Name of the last layer, used as feature extractor. Defaults to None.

Returns

A Keras model instance.