Here're some scripts I've used in order to preprocess my images and train the model. Most of it is based on tickets in there/stolen from answers to tickets.
1) create a folder pics and the subfolders raw_training & raw_validation. Copy your raw images to those 2 folders. Unzip preprocess.zip in that folder
2) unzip script in pics folder
3) Install pythonmagick & imagemagick (in venv in pics folder)
4) run init.bat in order to create the subfolders
5) run python conversion.py in order to resize images (multiple of 64 pixel, max x dimension 2048). The results will be stored in high_res/training & high_res/validation. You just have to run that one once in order to prepare the raw images. Images with an alpha channel or grayscale colorpsace will cause crashes during training otherwise.
6) run process.bat in order to create the training data off the raw images (e.g. resizing with imagemagick, sharpening, compression artifacts,...)
7) run python check.py in order to verify, that each image does exist in all training/validation sets and that the colorspace is valid. This script will also keep the directories in sync. If there's an invalid file in there, it will get deleted in all of those folders.
8) unzip training.zip to root
9) run each training script after another. adjust the weights_generator variable in scripts
2 & 3 and point it to the location of the files from the previous step
Those scripts are pretty raw, but maybe they'll help you to get started with your own experiments.
Just cancel the 2nd training script, when you want to continue with script 3. The amount of epochs is probably much too high in 2 and I never ran it so long.
Here're some scripts I've used in order to preprocess my images and train the model. Most of it is based on tickets in there/stolen from answers to tickets.
1) create a folder pics and the subfolders raw_training & raw_validation. Copy your raw images to those 2 folders. Unzip
preprocess.zip
in that folder 2) unzip script in pics folder 3) Install pythonmagick & imagemagick (in venv in pics folder) 4) runinit.bat
in order to create the subfolders 5) runpython conversion.py
in order to resize images (multiple of 64 pixel, max x dimension 2048). The results will be stored in high_res/training & high_res/validation. You just have to run that one once in order to prepare the raw images. Images with an alpha channel or grayscale colorpsace will cause crashes during training otherwise. 6) runprocess.bat
in order to create the training data off the raw images (e.g. resizing with imagemagick, sharpening, compression artifacts,...) 7) runpython check.py
in order to verify, that each image does exist in all training/validation sets and that the colorspace is valid. This script will also keep the directories in sync. If there's an invalid file in there, it will get deleted in all of those folders.8) unzip
training.zip
to root 9) run each training script after another. adjust theweights_generator
variable in scripts 2 & 3 and point it to the location of the files from the previous stepThose scripts are pretty raw, but maybe they'll help you to get started with your own experiments.
training.zip preprocess.zip