def _get_paths_from_images(path):
    'get image path list from image folder'
    assert os.path.isdir(path), '{:s} is not a valid directory'.format(path)
    images = []
    for (dirpath, _, fnames) in sorted(os.walk(path)):
        for fname in sorted(fnames):
            if is_image_file(fname):
                img_path = os.path.join(dirpath, fname)
                images.append(img_path)
    assert images, '{:s} has no valid image file'.format(path)
    return images
get image path list from image folder
def _get_paths_from_images(path):
    
    assert os.path.isdir(path), '{:s} is not a valid directory'.format(path)
    images = []
    for (dirpath, _, fnames) in sorted(os.walk(path)):
        for fname in sorted(fnames):
            if is_image_file(fname):
                img_path = os.path.join(dirpath, fname)
                images.append(img_path)
    assert images, '{:s} has no valid image file'.format(path)
    return images