(path)
| 20 | |
| 21 | |
| 22 | def _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 | |
| 33 | def mkdir(path): |
| 34 | if not os.path.exists(path): |
no test coverage detected