Importing multiple images using cv2
Hello
After importing multiple images into python using cv2.imread(), I have stored the path corresponding to each image as a list using glob as below import glob files=glob.glob("D:\ML\Image processing\Cats and Dogs\\.jpg",recursive=True)
Now I would like to create a list to store the folder names corresponding to each image, like 'Cats', 'Dogs' by splitting the path, please help me with that.
sorry, but splitting strings / pathes is basic python fu, and beyond the scope of this page. (get a book, do a course, learn something yourself, instead of asking around !)
Okay. Thanks
glob will return a sorted list !
if it's the same dataset i have, then you know, that the 1st 600 are cats and the last 699 are dogs ;)