code: def export_model_to_onnx(
      model: Model,
      model_name: str,
      dummy_input: List[tf.TensorSpec],
      **kwargs: Any,
  ) -> Tuple[str, List[str]]:
      """Export model to ONNX format.
  
      >>> import tensorflow as tf
      >>> from doctr.models.classification import resnet18
      >>> from doctr.models.utils import export_classification_model_to_onnx
      >>> model = resnet18(pretrained=True, include_top=True)
      >>> export_model_to_onnx(model, "my_model",
      >>> dummy_input=[tf.TensorSpec([None, 32, 32, 3], tf.float32, name="input")])
  
      Args:
      ----
          model: the keras model to be exported
          model_name: the name for the exported model
          dummy_input: the dummy input to the model
          kwargs: additional arguments to be passed to tf2onnx
  
      Returns:
      -------
          the path to the exported model and a list with the output layer names
      """
      large_model = kwargs.get("large_model", False)
      model_proto, _ = tf2onnx.convert.from_keras(
          model,
          input_signature=dummy_input,
          output_path=f"{model_name}.zip"
          if large_model
          else f"{model_name}.onnx",
          **kwargs,
      )
      # Get the output layer names
      output = [n.name for n in model_proto.graph.output]
  
      # models which are too large (weights > 2GB while converting to ONNX) needs to be handled
      # about an external tensor storage where the graph and weights are seperatly stored in a archive
      if large_model:
          logging.info(f"Model exported to {model_name}.zip")
          return f"{model_name}.zip", output
  
      logging.info(f"Model exported to {model_name}.zip")
      return f"{model_name}.onnx", output
  
file_path: doctr/doctr/models/utils/tensorflow.py
imports: import logging
  import os
  from typing import Any, Callable, List, Optional, Tuple, Union
  from zipfile import ZipFile
  import tensorflow
  import tf2onnx
  from tensorflow.keras import Model, layers
  from doctr.utils.data import download_from_url
label_desc: Use image node_id 5 for calling a global function with example usage: export_model_to_onnx(model, model_name, dummy_input) and returns: model_name, str,  output, model_name, str,  output