code: def read_pbtxt(filename):
      category_index = {}
      with open(filename, "r") as reader:
          txt = str(reader.read())
          txt = txt.replace(" ", "").replace("{", "").replace("}", "")
          txtList = txt.split("item")[1:]
          for index, line in enumerate(txtList):
              line = line.strip("\n").split("\n")
              category_index[index + 1] = {
                  "id": int(line[0][3:]),
                  "name": line[1][6:-1],
              }
      return category_index
  
file_path: deep-learning-for-image-processing/others_project/readPbFile/using_function.py
imports: import collections
  import six
  import PIL.Image
  import PIL.ImageDraw
  import PIL.ImageFont
  import numpy
  import tensorflow
  import cv2
label_desc: Use image node_id 4 for calling a global function with example usage: read_pbtxt(filename) and returns: category_index