:py:mod:`anomalib.utils.callbacks.export` ========================================= .. py:module:: anomalib.utils.callbacks.export .. autoapi-nested-parse:: Callback that compresses a trained model by first exporting to .onnx format, and then converting to OpenVINO IR. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: anomalib.utils.callbacks.export.ExportCallback Attributes ~~~~~~~~~~ .. autoapisummary:: anomalib.utils.callbacks.export.logger .. py:data:: logger .. py:class:: ExportCallback(input_size: Tuple[int, int], dirpath: str, filename: str, export_mode: str) Bases: :py:obj:`pytorch_lightning.Callback` Callback to compresses a trained model. Model is first exported to ``.onnx`` format, and then converted to OpenVINO IR. :param input_size: Tuple of image height, width :type input_size: Tuple[int, int] :param dirpath: Path for model output :type dirpath: str :param filename: Name of output model :type filename: str .. py:method:: on_train_end(trainer, pl_module: anomalib.models.components.AnomalyModule) -> None Call when the train ends. Converts the model to ``onnx`` format and then calls OpenVINO's model optimizer to get the ``.xml`` and ``.bin`` IR files.