code: def export_to_onnx(
      model: AnomalyModule,
      input_size: tuple[int, int],
      export_path: Path,
  ) -> Path:
      """Export model to onnx.
  
      Args:
          model (AnomalyModule): Model to export.
          input_size (list[int] | tuple[int, int]): Image size used as the input for onnx converter.
          export_path (Path): Path to the root folder of the exported model.
  
      Returns:
          Path: Path to the exported onnx model.
      """
      onnx_path = export_path / "model.onnx"
      torch.onnx.export(
          model.model,
          torch.zeros((1, 3, *input_size)).to(model.device),
          str(onnx_path),
          opset_version=11,
          dynamic_axes={
              "input": {0: "batch_size"},
              "output": {0: "batch_size"},
          },
          input_names=["input"],
          output_names=["output"],
      )
  
      return onnx_path
  
imports: from __future__ import annotations
  import json
  import logging
  import subprocess
  from enum import Enum
  from importlib.util import find_spec
  from pathlib import Path
  from typing import Any
  from warnings import warn
  import numpy
  import torch
  from torch import Tensor
  from torch.types import Number
  from anomalib.data.task_type import TaskType
  from anomalib.models.components import AnomalyModule
label_desc: Use image node_id 5 for calling a global function with example usage: export_to_onnx(model, input_size, export_path) and returns: onnx_path