code: def load_graphdef(filename: str) -> tf.compat.v1.GraphDef:
      if "pbtxt" in filename:
          graph_def = text_format.Parse(
              open(filename, "r").read(), tf.compat.v1.GraphDef()
          )
      else:
          graph_def = tf.compat.v1.GraphDef()
          graph_def.ParseFromString(open(filename, "rb").read())
      return graph_def
  
imports: from google.protobuf import text_format
  import tensorflow
  from typing import List
label_desc: Use image node_id 1 for calling a global function with example usage: load_graphdef(filename) and returns: graph_def