MCPcopy Create free account
hub / github.com/csxmli2016/MARCONetPlusPlus / _get_paths_from_images

Function _get_paths_from_images

utils/utils_image.py:22–31  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

20
21
22def _get_paths_from_images(path):
23 assert os.path.isdir(path), '{:s} is not a valid directory'.format(path)
24 images = []
25 for dirpath, _, fnames in sorted(os.walk(path)):
26 for fname in sorted(fnames):
27 if is_image_file(fname):
28 img_path = os.path.join(dirpath, fname)
29 images.append(img_path)
30 assert images, '{:s} has no valid image file'.format(path)
31 return images
32
33def mkdir(path):
34 if not os.path.exists(path):

Callers 1

get_image_pathsFunction · 0.85

Calls 1

is_image_fileFunction · 0.85

Tested by

no test coverage detected