MCPcopy
hub / github.com/NVlabs/SPADE / get_paths

Method get_paths

data/ade20k_dataset.py:29–46  ·  view source on GitHub ↗
(self, opt)

Source from the content-addressed store, hash-verified

27 return parser
28
29 def get_paths(self, opt):
30 root = opt.dataroot
31 phase = 'val' if opt.phase == 'test' else 'train'
32
33 all_images = make_dataset(root, recursive=True, read_cache=False, write_cache=False)
34 image_paths = []
35 label_paths = []
36 for p in all_images:
37 if '_%s_' % phase not in p:
38 continue
39 if p.endswith('.jpg'):
40 image_paths.append(p)
41 elif p.endswith('.png'):
42 label_paths.append(p)
43
44 instance_paths = [] # don't use instance map for ade20k
45
46 return label_paths, image_paths, instance_paths
47
48 # In ADE20k, 'unknown' label is of value 0.
49 # Change the 'unknown' label to the last label to match other datasets.

Callers

nothing calls this directly

Calls 1

make_datasetFunction · 0.90

Tested by

no test coverage detected