b152ed9c3252c386f43ff2c01ceb29f11bbcd105,research/object_detection/dataset_tools/create_ava_actions_tf_record.py,Ava,get_label_map,#Ava#Any#,307

Before Change


    with open(path, "r") as f:
      current_id = -1
      current_label = ""
      for line in f:
        if "item {" in line:
          current_id = -1
          current_label = ""
        if "name:" in line:
          first_quote = line.find(""") + 1
          second_quote = line.find(""", first_quote)
          assert second_quote > -1
          current_label = line[first_quote:second_quote]
        if "id:" in line:
          current_id = int(line.split()[1])
        if "}" in line:
          label_map[current_id] = bytes23(current_label)
    logging.info(label_map)
    assert len(label_map) == NUM_CLASSES
    return label_map

After Change


  def get_label_map(self, path):
    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:
      //label_map_util.load_labelmap()
      //label_map_str = f.read()
      //print(str(label_map_str))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 13

Instances


Project Name: tensorflow/models
Commit Name: b152ed9c3252c386f43ff2c01ceb29f11bbcd105
Time: 2020-08-14
Author: kaushikshiv@google.com
File Name: research/object_detection/dataset_tools/create_ava_actions_tf_record.py
Class Name: Ava
Method Name: get_label_map


Project Name: hellohaptik/chatbot_ner
Commit Name: e870ef14c590502fb0dc5ff3199e2602a87ec008
Time: 2019-03-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/detectors/numeral/budget/budget_detection.py
Class Name: BudgetDetector
Method Name: _detect_min_budget


Project Name: hellohaptik/chatbot_ner
Commit Name: e870ef14c590502fb0dc5ff3199e2602a87ec008
Time: 2019-03-18
Author: jain.chirag925@gmail.com
File Name: ner_v1/detectors/numeral/budget/budget_detection.py
Class Name: BudgetDetector
Method Name: _detect_max_budget