I want to create a ML classifier using images just like this example.
I have two classes of images in two different folders. Is there an easier way to import all images from both folders rather than inserting picture by picture?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.Sign up to join this community
Yes, in order to create your list of images you can use the following piece of code:
Join[ Thread@Rule[Import["~/Desktop/folder1/*.png"], "Day"], Thread@Rule[Import["~/Desktop/folder2/*.png"], "Night"] ]
Of course you will need to change the file path and the properties (day/night) appropriately.