emilwallner / Coloring-greyscale-images

Coloring black and white images with deep learning.
MIT License
1.03k stars 227 forks source link

Output is grayscale #2

Closed codingcatgirl closed 6 years ago

codingcatgirl commented 6 years ago

I tried running your colornet_script.py. Like in your example, i tried running it with the same image as training and test data. It runs smoothly, but the output image is grayscale. What might be the cause for that?

microic commented 6 years ago

I tried too, the output is also grayscale https://github.com/microic/niy/tree/master/examples/colorizing_photos

emilwallner commented 6 years ago

It's tricky to get good results. A lot of has to do with how many epochs you train it and which training data you use. I'd recommend starting with 20-100 images and saving at regular intervals. Once you get a feel for it, you can increase the number of images. Also, use a lot of validation images to understand where it's good and where it struggles.

Analyzing the loss data can also be hard. Initially, I noticed that the batch normalization makes the pictures sepia looking. Then it needs additional training to create colors. The loss curve can be misleading because of this.

For better results, I'd recommend adding a weighted classification, to favor vibrant colors. If I were to redo it today, I'd experiment with the pix2pixHD GAN structure: https://github.com/NVIDIA/pix2pixHD

microic commented 6 years ago

Thanks for your relay, I will remove batch normalization and try again I want to write an example for DL beginners, so the procedure should be easy, can be run on CPU fastly