code: def coreml_emit(
      original_framework,
      architecture_name,
      architecture_path,
      weight_path,
      test_input_path,
  ):
      from mmdnn.conversion.coreml.coreml_emitter import CoreMLEmitter
      from coremltools.models import MLModel
      import coremltools
      from PIL import Image
  
      def prep_for_coreml(prename, BGRTranspose):
          # The list is in RGB oder
          if prename == "Standard":
              return 0.00784313725490196, -1, -1, -1
          elif prename == "ZeroCenter":
              return 1, -123.68, -116.779, -103.939
          elif prename == "Identity":
              return 1, 1, 1, 1
          else:
              raise ValueError()
  
      # IR to Model
      # converted_file = original_framework + '_coreml_' + architecture_name + "_converted"
      # converted_file = converted_file.replace('.', '_')
  
      original_framework = checkfrozen(original_framework)
      func = TestKit.preprocess_func[original_framework][
          architecture_name
      ]
  
      import inspect
  
      funcstr = inspect.getsource(func)
  
      coreml_pre = funcstr.split("(")[0].split(".")[-1]
  
      if len(funcstr.split(",")) == 3:
          BGRTranspose = bool(0)
          size = int(funcstr.split("path,")[1].split(")")[0])
          prep_list = prep_for_coreml(coreml_pre, BGRTranspose)
      elif len(funcstr.split(",")) == 4:
          BGRTranspose = funcstr.split(",")[-2].split(")")[
              0
          ].strip() == str(True)
          size = int(funcstr.split("path,")[1].split(",")[0])
          prep_list = prep_for_coreml(coreml_pre, BGRTranspose)
  
      elif len(funcstr.split(",")) == 11:
          BGRTranspose = funcstr.split(",")[-2].split(")")[
              0
          ].strip() == str(True)
  
          size = int(funcstr.split("path,")[1].split(",")[0])
          prep_list = (
              float(funcstr.split(",")[2]),
              float(funcstr.split(",")[3].split("[")[-1]),
              float(funcstr.split(",")[4]),
              float(funcstr.split(",")[5].split("]")[0]),
          )
  
      emitter = CoreMLEmitter(architecture_path, weight_path)
  
      model, input_name, output_name = emitter.gen_model(
          input_names=None,
          output_names=None,
          image_input_names=test_input_path,
          is_bgr=BGRTranspose,
          red_bias=prep_list[1],
          green_bias=prep_list[2],
          blue_bias=prep_list[3],
          gray_bias=0.0,
          image_scale=prep_list[0],
          class_labels=None,
          predicted_feature_name=None,
          predicted_probabilities_output="",
      )
  
      input_name = str(input_name[0][0])
      output_name = str(output_name[0][0])
  
      # load model
      model = MLModel(model)
  
      # save model
      # coremltools.utils.save_spec(model.get_spec(), converted_file)
  
      if not is_coreml_supported():
          return None
      else:
          from PIL import Image as pil_image
  
          img = pil_image.open(test_input_path)
          img = img.resize((size, size))
  
          # inference
  
          coreml_input = {input_name: img}
          coreml_output = model.predict(coreml_input)
          prob = coreml_output[output_name]
          prob = np.array(prob).squeeze()
  
          return prob
  
imports: from __future__ import absolute_import
  from __future__ import print_function
  import os
  import sys
  import imp
  import numpy
  from mmdnn.conversion.examples.imagenet_test import TestKit
  import utils
  from utils import *
  from datetime import datetime
label_desc: Use image node_id 18 for calling the TestModels obj's underlying member method code with example usage: obj.coreml_emit(original_framework, architecture_name, architecture_path, weight_path, test_input_path) and returns: None, prob, int,  unknown,  unknown,  unknown, int,  unknown,  unknown,  unknown, int,  int,  int,  int