MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / get_label2id

Function get_label2id

kerascv/pascal2coco.py:12–17  ·  view source on GitHub ↗

id is 1 start

(labels_path: str)

Source from the content-addressed store, hash-verified

10
11
12def get_label2id(labels_path: str) -> Dict[str, int]:
13 """id is 1 start"""
14 with open(labels_path, 'r') as f:
15 labels_str = f.read().split()
16 labels_ids = list(range(0, len(labels_str)))
17 return dict(zip(labels_str, labels_ids))
18
19
20def get_annpaths(ann_dir_path: str = None,

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected