How to form a list of images of multiple formats in a Kaggle dataset where the image paths are like? Working in Kaggle I wanted to convert the image paths into the list so that I can store and perform operations but couldn't find a proper image traversing Algo to give me the required list result.
Tree for the image is:
|-data
|-images
|-ID0
|--- img4tgh4r3.jpg
|--- img324633.png
|
.
.
|-ID1
.
.
I tried using ls -a but how do you convert this structure and save it into a data type to reuse it.
import os
path = "/"
dir_list = os.listdir(path)
print("Files and directories in '", path, "' :")
# print the list
print(dir_list)
This only lists the directories but not all the image types.