I have 50.000 in a folder that have names "1.png" to "50000.png". And I want to save them to some array in spesicfic order, because I have labels for them in order to classify them. So when order of the images get messed up, labels become useless. (i.e: 1.png will be saved to first index and 2.png will be saved to second index etc.). I try this code for this purpose:
#Read and save all Images to images array.
images=[]
image_folder=[img for img in glob.glob("C:/Users/yazilim1/Desktop/Jupyter/cifar-10/train/*.png")]
image_folder.sort()
for image in image_folder:
images.append(cv2.imread(image))
print(image)
print("Number of Images added:" + str(len(images)))
However, print(image) output looks like this:
How can I achive to save that images to "images" array with order?