Correcting and coloring old and damaged images using a CycleGAN
python convert.py input_file
This will fix a damaged image and and will colorize grayscale images.
This requires the weights ganban.pth
to be in the same directory. This can be downloaded from here.
Additional arguments are as follows:
usage: convert.py [-h] [-i] [-m] [-r] input_file [input_file ...]
Converts an old damaged image into a new colored image. Outputs a file(s) with the name input_file.<step>.png
positional arguments:
input_file input file(s)
options:
-h, --help show this help message and exit
-i, --intermediate Output (save) the intermediate states
-m, --multi-domain Use the multiple domain/model approach (damaged<>fixed<>color)
-r, --reverse Reverses the process (corrected image --> old image)
You can download the dataset used here. It contains ~900 unique images trained on for 3 different models.
Dataset location and directory to save models in.
Contains the hyperparameters.
Contains the generator, discriminator, and initialization weights.
Contains the class (Dataset) that interacts with the data
Setup for the train and test steps
Entry point to begin training the model. To start, execute python train.py
.