anomalib.models.dfkde.lightning_model¶
DFKDE: Deep Feature Kernel Density Estimation.
Module Contents¶
Classes¶
DFKDE: Deep Feature Kernel Density Estimation. |
|
DFKDE: Deep Feature Kernel Density Estimation. |
Attributes¶
- class anomalib.models.dfkde.lightning_model.Dfkde(backbone: str, max_training_points: int = 40000, pre_processing: str = 'scale', n_components: int = 16, threshold_steepness: float = 0.05, threshold_offset: int = 12)[source]¶
Bases:
anomalib.models.components.AnomalyModuleDFKDE: Deep Feature Kernel Density Estimation.
- Parameters
backbone (str) – Pre-trained model backbone.
max_training_points (int, optional) – Number of training points to fit the KDE model. Defaults to 40000.
pre_processing (str, optional) – Preprocess features before passing to KDE. Options are between norm and scale. Defaults to “scale”.
n_components (int, optional) – Number of PCA components. Defaults to 16.
threshold_steepness (float, optional) – Controls how quickly the value saturates around zero. Defaults to 0.05.
threshold_offset (float, optional) – Offset of the density function from 0. Defaults to 12.0.
- static configure_optimizers()[source]¶
DFKDE doesn’t require optimization, therefore returns no optimizers.
- training_step(self, batch, _batch_idx)[source]¶
Training Step of DFKDE. For each batch, features are extracted from the CNN.
- Parameters
batch (Dict[str, Any]) – Batch containing image filename, image, label and mask
_batch_idx – Index of the batch.
- Returns
Deep CNN features.