Make sure to install all dependencies listed in requirements.txt
.
In order to start model training, follow these steps:
- Make sure, the dataset folder sticks to the structure explained below.
- Place
.yaml
file in theparams
folder describing the training parameters. Inexample.yaml
you can find a valid configuration. - The model name ist defined in the
.yaml
file, as well. This name will be used to identifiy stored models, as well. - Call
python3 train.py modelname.yaml
. - You can find the resulting training statistics and model parameter files after training has finished in the
saved_models
directory.
The dataset folder needs to be placed inside the project root directory. This folder then splits into different sub-directories naming all the different datasets that can be used while training and evaluation. Inside the dataset folders, there is one photo folder and one sketch folder, containing each directories for image categories (for shoes, there is only one category).
dataset
|dataset1
|photo
|class1
|image files...
|class2
|image files...
|...
|classN
|sketch
|class1
|image files...
|class2
|image files...
|...
|classN
|dataset2
|photo
|...
Click to expand!
After the training of a model has finished, the used random train-test split is saved to the model parameter file, as well. When evaluating or generating images using a trained model, the corresponding test images will be used in order to maintain a clean data split. Follow these steps for generating images from a trained model:
- Search for the name of the model you want to use in the
saved_models
directory. - Use this model name to call
python3 generator.py modelname --generate
. - The generated images are stored in the
generator/modelname
directory.
train.py is used to initialize training procedures.
data.py contains dataset implementation and preprocessing.
architecture.py builds cINN structure. Our Autoencoder extension is build by autoencoder.py, instead.
metrics_wrapper.py is meant to call evaluation procedures.
generator.py can be used to let a trained model generate images.
You can call python3 train.py --help
to see accepted command line parameters. This is possible for train.py, metrics_wrapper.py and generator.py.