package | version |
---|---|
tensorflow | 1.8.0 |
python-opencv | 3.4.0 |
configparser |
Due to the limitation of devices, I use the tensorflow-cpu, the tesorflow-gpu surely can be a better substitude.
Here is some tools for making dataset in image_util.py. Anyway, the shape of facial image should be (64 x 64 x 3).Then put the facial image in 'data_1' folder.
Checking the 'net.cfg' is neccssary before running 'cly_dcgan.py'. The model would be saved in the folder 'model'. You can get loss detail showed in tensorboard. And images generated by G would be saved in folder 'result', shows the preformance of net. You can stop the trainning if you are satisfy with the generated image. If the trainning was stopped accidently, you can recover the model with code in line 170 in 'cly_dcgan.py'.
Now we have some good model choosable, replace the number of 'model_index' in 'bet.cfg' with index of choosed model. Put the image to be repaired in somewhere and modify the path of 'target_path' in 'net.cfg'. Run 'repair.py'. The relevent result would be saved in folder 'repair'. Revise the code in method 'get_target_img()' in 'image_util.py' if you want to change the area of target image to be repaird(generated), it’s really inconvenient...