Skip to content

About

Deep Learning Repo to Colorize Black & White Images

Resources

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

Image Coloring

A project to color a black and white image to color using deep learning

How to run

First install the neccessary libraries

pip install -r requirements.txt

Download the model and run script

python demo_autoencoder.py -p -m model/effnet_colorizer.h5 -i data/path/to/image

or pix2pix (generally more accurate)

python demo_pix2pix.py -i data/path/to/image

Intution

The idea on how to convert an image from black white to a color image can be broken down to the following steps:

  1. Read Image as RGB
  2. Convert Image to Lab Color Space
  3. Create neural network to map L color space to ab color space
  4. Model will use L (black white) to predict ab color space
  5. Create empty image and add L image and ab image to form a complete Lab Image
  6. Convert Lab Image to RGB again to get back a colorize image

Results

image_results

ToDO

  • Train AutoEncoder with Fusion of Pretrained Model
  • Add metrics specified here
  • Inference script for all models
  • Train pix2pix(GAN) model for more accurate results
  • Train with dynamic unet for pix2pix
  • Use pytorch image quality metrics for image quality assements
  • Converted model to onnx for deployment
  • Onnx Inference Script
  • If time is available move to deployment architecture (FAST API)

ToDO Clean Up

  • Upload model drive download links
  • Requirements txt
  • Add Demo Results
  • Write out findings
  • Try to move to specified architecture using nvidia triton
  • Move preporcessing with a model instead of code

Notes

  • As of the current available models pretrained model with autoencoder seems to have better results
  • Previously though of metrics where eyeballing is unavoidable has changed a bit
  • Need to switch to pytorch for gan model as seems easier to read for now

Models

You can download the models trained here

Model Name Backbone Drive Link
Simple AutoEncoder None here
EffNet Autoencoder Efficient Net B3 here
Unet Pretrained Generator Resnet 18 here
Unet Finetuned Generator Resnet 18 here

Evaluation Score

Model DISTS Score
Pix2pix - Resnet18 0.7836

References

The following repos were based off these guides

About

Deep Learning Repo to Colorize Black & White Images

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages