This project uses DCGAN to implement gray image colorization. The network copys from aleju/colorizer.
caffe.proto:
Add the new line:
optional bool param_propagate_down = 6;
net.cpp
Add the following lines:
if(param_spec->has_param_propagate_down()){
param_need_backward = param_spec->param_propagate_down();
}
- The Installation completely the same as Caffe. Please follow the installation instructions.
- Make sure you uncomment
WITH_PYTHON_LAYER := 1
to support for python layer. And don't forgetmake pycaffe
- Add the
~/caffe_GAN/caffe_GAN/gan_example/lib/layers
path to$PYTHONPATH
- Make sure you uncomment
- Building the dataset:
- Download Labeled Faces in the Wild and extract it somewhere
- In
gan_example/
runmkdir out_unaug_64x64
and runpython lib/utils/generate_dataset.py --path="lfw"
, wherelfw
is the path to your LFW dataset - Generate the train.txt file:
- In
out_unaug_64x64/
runls -1 > ../train.txt
- Train
gan_example/
run./train.sh
begin training.
- The generate images will be putted in
output
directory.