I'm in an introductory neural networking class so mind my ignorance.
I have a folder containing roughly 12,000 texture images, each divided into ten different subsets. An example file name would be bubbly_0012.png. Some file names begin with the same first letter, for example, bubbly_0012.png and blotchy_0012.png.
I'm trying to create a .csv file containing arrays of each of the images. I want to label each image according to their subset (and therefore their name), so that bubbly is given the label 0, blotched is given the label 1, as so on.
I found that I'm able to do this with the first letter of each file name using this line:
if (file[0]) == "b":
name_array = [[0]]
However, this becomes an issue when I try and label subsets that begin with the same letter For the blotchy subset, I tried the following:
if (file[0:1]) == "bl":
name_array = [[0]]
But this didn't work.
Any advice would be greatly appreciated.