This repo contain the project to train and test a conditional generative adversarial network model to colorize black and white images. The implementation is based on Ian Goodfellow's GAN paper.
This project is implemented with Tensorflow, to install the latest version of Tensorflow, follow the instructions on this page.
To train on your own dataset, use
python noir2color.py --bw-folder bw --colored-folder color
You can also set other parameters using the command line, for example
python noir2color.py --keep-prob 0.5
For information about specifying other parameters, type
python noir2color.py -h
To use a trained model, use the model_test function in colorizer.py. The function takes one or a list of black and white images and output the colorized. For details regrading the arguments for this function, check the docstring.
To colorize one single image, use
python colorizer.py --meta dir/to/saved/model --input input_image.jpg
The trained models are saved at this repo, and datasets at this repo.