code: def __init__(self, model):
      super(CoremlParser, self).__init__()
  
      # load model file into Coreml Graph
      if isinstance(model, _string_types):
          # model.encode() convert to str --- python2 may crash due to type 'unicode'
          model = _MLModel(model)
          model = model.get_spec()
          self.weight_loaded = True
      else:
          assert False
  
      # Build Network Graph
  
      model_type = model.WhichOneof("Type")
      if model_type == "neuralNetworkClassifier":
          CoremlParser.shape_dict = infer_shapes(
              model.neuralNetworkClassifier, model.description.input
          )
      elif model_type == "neuralNetwork":
          CoremlParser.shape_dict = infer_shapes(
              model.neuralNetwork, model.description.input
          )
      elif model_type == "neuralNetworkRegressor":
          CoremlParser.shape_dict = infer_shapes(
              model.neuralNetworkRegressor, model.description.input
          )
      else:
          assert False
  
      # self.data_format ? TODO
      self.data_format = "channels_first"
      self.coreml_graph = CoremlGraph(model)
      self.coreml_graph.build()
      self.lambda_layer_count = 0
  
imports: import os
  from six import string_types
  import numpy
  import math
  from coremltools.models.neural_network import NeuralNetworkBuilder
  from coremltools.models import datatypes
  from coremltools.models import MLModel
  from coremltools.models.utils import save_spec
  from coremltools.models._infer_shapes_nn_mlmodel import infer_shapes
  from coremltools.proto import Model_pb2, NeuralNetwork_pb2
  from mmdnn.conversion.coreml.coreml_graph import CoremlGraph
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
  from mmdnn.conversion.common.DataStructure.parser import Parser
  from mmdnn.conversion.common.utils import *
label_desc: Use image node_id 1 to create a new CoremlParser object from inherited base classes: Parser with example: obj = CoremlParser(model)