anomalib.utils.callbacks.model_loader

Callback that loads model weights from the state dict.

Module Contents

Classes

LoadModelCallback

Callback that loads the model weights from the state dict.

Attributes

anomalib.utils.callbacks.model_loader.logger[source]
class anomalib.utils.callbacks.model_loader.LoadModelCallback(weights_path)[source]

Bases: pytorch_lightning.Callback

Callback that loads the model weights from the state dict.

on_test_start(self, _trainer, pl_module: anomalib.models.components.AnomalyModule) None[source]

Call when the test begins.

Loads the model weights from weights_path into the PyTorch module.

on_predict_start(self, _trainer, pl_module: anomalib.models.components.AnomalyModule) None[source]

Call when inference begins.

Loads the model weights from weights_path into the PyTorch module.