Skip to content

guilbera/colorizing

Repository files navigation

Autoencoders Keras implementation Autoencoders PyTorch implementation Pix2Pix
Open In Colab Open In Colab Open In Colab

colorizing

Alt text

This is a project about colorizing black and white images using deep learning. The results are summarised in the medium blog post "Black and White Image Colorization with Deep Learning". 3 models are implemented:

  • beta model, which consists of an autoencoder
  • gamma model, which consists of the same autoencoder with a classifier used in parallel of the encoder
  • Pix2Pix model, which is a GAN

The beta and gamma models are implemented in both Keras and PyTorch while the Pix2Pix model is implemented only in PyTorch.

The dataset used for the training of the model can be downloaded here and originates from here.

Utilities

All the models use the pix utility (/notebooks/utilities/pix.ipynb) to copy the dataset from Google Drive to Google Colab and to convert RGB images to Lab images and vice versa.

Beta and Gamma model in Keras

The jupyter notebooks can be found in /notebooks/keras_implementation/.

pix_keras.ipynb contains the dataloader.

autoencoder_keras.ipynb contains the beta and gamma model implementation.

put_together_keras.ipynb enables training the models in Google Colab.

Beta and Gamma model in PyTorch

The jupyter notebooks can be found in /notebooks/pytorch_implementation/.

pix_pytorch.ipynb contains the dataloader.

autoencoder_pytorch.ipynb contains the beta and gamma model implementation.

put_together_pytorch.ipynb enables training the models in Google Colab.

Pix2Pix model

The jupyter notebooks can be found in /notebooks/pytorch_implementation/.

It uses the same dataloader as the beta and gamma model (pix_pytorch.ipynb).

pix2pix_model.ipynb contains the Pix2Pix implementation, it can output either 2 channels (Lab implementation) or 3 channels (RGB implementation).

put_together_pix2pix.ipynb enables training the models in Google Colab.

Getting started

All the Jupyter Notebooks can be opened directly from GitHub in Google Colab by clicking on the Google Colab badges at the top of the notebooks. Examples showing how to the different functions are working can be run for each notebook by changing the run_example flag to True.

Alt text

To train the model, simply click on the Google Colab badge at the top of the README. You can modify the parameters related to the model or the folders to save logs and checkpoints at the top of the notebooks.

Note that some notebooks open other notebooks as modules using the Kora library.

Results

Alt text

Copyright

See LICENSE for details.

Releases

No releases published

Packages

 
 
 

Contributors