code: def _convert_to_image_input(proto, inputs):
      tmp_model = MLModel(proto)
      for input_type in inputs:
          if isinstance(input_type, ImageType):
              if input_type.color_layout == "G":
                  gray_bias = input_type.bias
                  red_bias, green_bias, blue_bias = 0.0, 0.0, 0.0
              elif input_type.color_layout == "RGB":
                  gray_bias = 0.0
                  red_bias, green_bias, blue_bias = input_type.bias
              elif input_type.color_layout == "BGR":
                  gray_bias = 0.0
                  blue_bias, green_bias, red_bias = input_type.bias
              tmp_model = neural_network.utils.make_image_input(
                  tmp_model,
                  input_type.name,
                  is_bgr=input_type.color_layout == "BGR",
                  image_format="NCHW"
                  if input_type.channel_first
                  else "NHWC",
                  red_bias=red_bias,
                  green_bias=green_bias,
                  blue_bias=blue_bias,
                  gray_bias=gray_bias,
                  scale=input_type.scale,
              )
      return tmp_model.get_spec()
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import logging
  from collections import defaultdict
  from coremltools.converters.mil.input_types import ClassifierConfig, ImageType, EnumeratedShapes, Shape, RangeDim
  from coremltools.models import MLModel
  from coremltools.models import neural_network
  import coremltools.models.datatypes
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.types.symbolic import any_symbolic, any_variadic, is_symbolic
  from .op_mapping import convert_ops
  from coremltools.models.neural_network import flexible_shape_utils
  from coremltools.models.neural_network.flexible_shape_utils import update_image_size_range, add_enumerated_image_sizes, set_multiarray_ndshape_range, add_multiarray_ndshape_enumeration
  from .passes.nn_passes import nn_backend_passes
  from coremltools.converters._profile_utils import _profile
label_desc: Use image node_id 1 for calling a global function with example usage: _convert_to_image_input(proto, inputs) and returns: tmp_model