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

Function get_annpaths

kerascv/pascal2coco.py:20–35  ·  view source on GitHub ↗
(ann_dir_path: str = None,
                 ann_ids_path: str = None,
                 ext: str = '',
                 annpaths_list_path: str = None)

Source from the content-addressed store, hash-verified

18
19
20def get_annpaths(ann_dir_path: str = None,
21 ann_ids_path: str = None,
22 ext: str = '',
23 annpaths_list_path: str = None) -> List[str]:
24 # If use annotation paths list
25 if annpaths_list_path is not None:
26 with open(annpaths_list_path, 'r') as f:
27 ann_paths = f.read().split()
28 return ann_paths
29
30 # If use annotaion ids list
31 ext_with_dot = '.' + ext if ext != '' else ''
32 with open(ann_ids_path, 'r') as f:
33 ann_ids = f.read().split()
34 ann_paths = [os.path.join(ann_dir_path, aid+ext_with_dot) for aid in ann_ids]
35 return ann_paths
36
37
38def get_image_info(annotation_root, extract_num_from_imgid=True):

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected