I just finished writing a script to separate my data into a train and validation folder and also shuffle the data.
My problem is that when I get data from the internet through API’s or via scraping I will usually end up with multiple directories where all my images will be held.
- cats(contains all cat images)
- dogs(contains all dog images)
- elephants(contains all elephant images)
But for Keras you need to split this data into training and validation. As you can imagine doing this by hand is way too much work so I created a little script that will automatically shuffle your data and then move it into a train and valid directory while keeping your directory structure the same so it will look like this:
The script is by no means perfect, I am not an expert programmer and most of it was just copy pasted: