Skip to content

Show me the solution #1 #11

@victorcmoura

Description

@victorcmoura

Problem: Colorizing black and white images

  • Default solution: Colorize by hand, with photo editors
  • Proposed solution: Colorize automatically by previous experiences (based on a tutorial by Emil Wallner)

Techincal explanation

  1. Getting the dataset
    • Public image dataset made available by Emil
  2. Convert colored images from RGB to Lab
    • L: Lightness (Black and white picture)
    • a: green-red
    • b: blue-yellow

image

This way, instead of predicting 3 channels (red, green, blue), there remains only two.

image

  1. Max-pooling
    • Technique used to increase detail density.

image

  1. Fusion architecture

    • Encoder (Smaller image patches)
    • Decoder (Global priors)
    • Fusion
  2. Software Engineering improvements

    • Instead of a jupyter notebook, the code has been transformed into a Python package
    • Pipenv has been used as a configuration manager
    • Trained models have been saved in .h5 files, to save time
    • A CLI has been implemented to enhance the usability

Results

Test training (i7 8750H, 6 cores, 16GB RAM)

Dataset size: 999 images
Epochs: 10
Step: 2 (500 images per batch)

image

Time elapsed: ~40m

Local training (i7 4500U, 4 cores, 16GB RAM)

Dataset size: 20 images
Epochs: 50
Step: 2 (10 images per batch)

image

Time elapsed: ~10h

Google Cloud 8 cores, 30GB RAM

Dataset size: 5000 images
Epochs: 1000
Step: 20

image

Time elapsed: 50h

Google Cloud 8 cores, 30GB RAM

Dataset size: 400 images
Epochs: 1000
Step: 20

image

Time elapsed: 48h12min

Lessons learned

  • Deep learning is $$$$$
  • General networks are harder to achieve
  • Dependencies errors or mismatch
  • Difficulty to use GPU to train the model

Future Works

  • Find better parameters from training
  • Use GPU for Training
  • Use GAN (Generative Adversarial Network) for better results
  • Create CI/CD for releases

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions