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?
Classify actually supports a nice syntax for this:
Classify[<|"class1" -> Import["class1/*"], "class2" -> Import["class2/*"]|>]
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.