Parses a label map into {integer:string} format.
label_map = {}
label_map = label_map_util.load_labelmap(path)
print(label_map)
label_map_dict = {}
for item in label_map.item:
label_map_dict[item.name] = item.label_id
with open(path, "rb") as f:
After Change
def get_label_map(self, path):
Parses a label map into {integer:string} format.
label_map_dict = label_map_util.get_label_map_dict(path)
label_map_dict = {v: bytes(k, "utf8") for k, v in label_map_dict.items()}
logging.info(label_map_dict)
return label_map_dict