code: def __init__(self, model_config, weightfile, yolo):
      super(DarknetParser, self).__init__()
  
      if not os.path.exists(model_config):
          raise ValueError(
              "Darknet model config [{}] can not be found!".format(
                  model_config
              )
          )
  
      if weightfile:
          self.weight_loaded = True
  
      fp = open(weightfile, "rb")
      header = np.fromfile(fp, count=4, dtype=np.int32)
      self.buf = np.fromfile(fp, dtype=np.float32)
      print("weights buf size: {}".format(self.buf.size))
  
      fp.close()
  
      # yolo3(608) start at 1, yolo2(608) start at 0. yolo2(416) start at 1, yolo3(416) start at 0
      if yolo == "1":
          self.start = 1  # yolov3
      else:
          self.start = 0  # yolov2
  
      model = parse_cfg(model_config)
      self.dk_graph = DarknetGraph(model)
      self.dk_graph.build()
  
imports: import os
  import numpy
  from mmdnn.conversion.common.utils import *
  from mmdnn.conversion.darknet.prototxt import *
  from mmdnn.conversion.darknet.darknet_utils import *
  from mmdnn.conversion.darknet.darknet_graph import DarknetGraph
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.common.DataStructure.parser import Parser
  from mmdnn.conversion.common.IR.graph_pb2 import NodeDef, GraphDef, DataType
label_desc: Use image node_id 2 to create a new DarknetParser object from inherited base classes: Parser with example: obj = DarknetParser(model_config, weightfile, yolo)