def get_imagenet_dict(txt_path):
  """

  Make ImageNet ground truth dict.
  The ground truth dictionay maps
  a class index to its label.

  The .txt file can be found at:
  https://gist.github.com/yrevar/942d3a0ac09ec9e5eb3a

  Parameters
  ----------
  txt_path: str
  Path to the txt file with ImageNet
  class index-to-label mappings.

  Returns
  ----------
  dict
  A dictionay with class indices as
  keys and their corresponding ImageNet
  labels as values.

  """
  imagenet_dict = {}
  with open(txt_path, 'r') as f:
    for __l in f.readlines():
      key, val = __l.split(':')
      __v = val.strip()[:-1].replace("'", '')
      imagenet_dict[int(key)] = __v
  return imagenet_dict