# Scanning the directory using os python function img_dirs = [] for entry in os.scandir(path_to_data): if entry.is_dir(): img_dirs.append(entry.path)
# Scanning the directory using os python function img_dirs = [] for entry in os.scandir(path_to_data): if entry.is_dir(): img_dirs.append(entry.path)