class_docstr: Base class for caffe2-compatible implementation of a meta architecture.
  The forward is traceable and its traced graph can be converted to caffe2
  graph through ONNX.
docstr: Creates a function that converts outputs of the caffe2 model to
  detectron2's standard format.
  The function uses information in `predict_net` and `init_net` that are
  available at inferene time. Therefore the function logic can be used in inference.
  
  The returned function has the following signature:
  
      def convert(batched_inputs, c2_inputs, c2_results) -> detectron2_outputs
  
  Where
  
      * batched_inputs (list[dict]): the original input format of the meta arch
      * c2_inputs (tuple[Tensor]): the caffe2 inputs.
      * c2_results (dict[str, Tensor]): the caffe2 output format,
          corresponding to the outputs of the :meth:`forward` function.
      * detectron2_outputs: the original output format of the meta arch.
  
  This function can be used to compare the outputs of the original meta arch and
  the converted caffe2 graph.
  
  Returns:
      callable: a callable of the above signature.
code: def get_outputs_converter(predict_net, init_net):
      """
      Creates a function that converts outputs of the caffe2 model to
      detectron2's standard format.
      The function uses information in `predict_net` and `init_net` that are
      available at inferene time. Therefore the function logic can be used in inference.
  
      The returned function has the following signature:
  
          def convert(batched_inputs, c2_inputs, c2_results) -> detectron2_outputs
  
      Where
  
          * batched_inputs (list[dict]): the original input format of the meta arch
          * c2_inputs (tuple[Tensor]): the caffe2 inputs.
          * c2_results (dict[str, Tensor]): the caffe2 output format,
              corresponding to the outputs of the :meth:`forward` function.
          * detectron2_outputs: the original output format of the meta arch.
  
      This function can be used to compare the outputs of the original meta arch and
      the converted caffe2 graph.
  
      Returns:
          callable: a callable of the above signature.
      """
      raise NotImplementedError
  
imports: import functools
  import io
  import struct
  import types
  import torch
  from detectron2.modeling import meta_arch
  from detectron2.modeling.box_regression import Box2BoxTransform
  from detectron2.modeling.roi_heads import keypoint_head
  from detectron2.structures import Boxes, ImageList, Instances, RotatedBoxes
  from .c10 import Caffe2Compatible
  from .caffe2_patch import ROIHeadsPatcher, patch_generalized_rcnn
  from .shared import alias, check_set_pb_arg, get_pb_arg_floats, get_pb_arg_valf, get_pb_arg_vali, get_pb_arg_vals, mock_torch_nn_functional_interpolate
label_desc: Use image node_id 6 for calling the Caffe2MetaArch obj's underlying member method code with example usage: obj.get_outputs_converter(predict_net, init_net) without return types