class_docstr: Callback to compresses a trained model.
  
  Model is first exported to ``.onnx`` format, and then converted to OpenVINO IR.
  
  Args:
      input_size (tuple[int, int]): Tuple of image height, width
      dirpath (str): Path for model output
      filename (str): Name of output model
docstr: 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.
docstr_tok: ["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","."]
code: def on_train_end(
      self, trainer: pl.Trainer, pl_module: 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.
      """
      logger.info("Exporting the model")
      Path(self.dirpath).mkdir(parents=True, exist_ok=True)
  
      export(
          task=trainer.datamodule.test_data.task,
          input_size=self.input_size,
          transform=trainer.datamodule.test_data.transform.to_dict(),
          model=pl_module,
          export_root=self.dirpath,
          export_mode=self.export_mode,
      )
  
file_path: anomalib/src/anomalib/utils/callbacks/export.py
imports: from __future__ import annotations
  import logging
  from pathlib import Path
  import pytorch_lightning
  from pytorch_lightning import Callback
  from anomalib.deploy import ExportMode, export
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 2 for calling the ExportCallback obj's underlying member method code with example usage: obj.on_train_end(trainer, pl_module) without return types