Skip to content

agarnung/image-colorization-exploration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image-colorization-exploration

An attempt to colorize my old photos

Our Solution

Among the countless architectural alternatives, we will design our own solution and train it using our own dataset. We will focus natural images, like those in the DIV2K dataset.

We use two approaches for the colorization task:

  • A variational approach (see this): It consists of minimizing an energy functional with two terms, a smoothing term that diffuses colors across objects and a fidelity term that preserves user-provided color hints, solved via Euler-Lagrange PDEs.
  • A Deep Learning aproach (see this): It uses a conditional GAN with U-Net generator and patch discriminator. The model combines adversarial loss (for realism), Huber loss (for color accuracy) and VGG loss (for perceptual integrity), trained in Lab space.
Ground Truth Colorization

Usage Instructions

If you want to fork my project and explore new or existing techniques yourself, simply create a virtual environment and install the necessary dependencies as follows:

1. Clone the project and create a virtual environment

git clone https://github.com/agarnung/image-colorization-exploration.git
cd image-colorization-exploration
python3 -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

2. Install the mask creation application

cd colorMaskerApp && pip install -e .

3. Run the application from anywhere (inside the venv) with the grayscale image you want to colorize

colormaskerapp --input "path/to/grayscale.png" --output "path/to/result/mask.png"

References

Please refer to the references cited in both methods's README (variational and DL).

About

An attempt to colorize my old photos

Resources

License

Stars

Watchers

Forks

Packages

No packages published