anomalib.utils.callbacks.openvino¶
Callback that compresses a trained model by first exporting to .onnx format, and then converting to OpenVINO IR.
Module Contents¶
Classes¶
Callback to compresses a trained model. |
Attributes¶
- class anomalib.utils.callbacks.openvino.OpenVINOCallback(input_size: Tuple[int, int], dirpath: str, filename: str)[source]¶
Bases:
pytorch_lightning.CallbackCallback to compresses a trained model.
Model is first exported to
.onnxformat, and then converted to OpenVINO IR.- Parameters
input_size (Tuple[int, int]) – Tuple of image height, width
dirpath (str) – Path for model output
filename (str) – Name of output model
- on_train_end(trainer, pl_module: anomalib.models.components.AnomalyModule) None[source]¶
Call when the train ends.
Converts the model to
onnxformat and then calls OpenVINO’s model optimizer to get the.xmland.binIR files.