Skip to content

DavidRamosArchilla/Colorizing-images

Repository files navigation

Image Colorization with Pix2Pix

An implementation of the Pix2Pix paper for image colorization using PyTorch.
Try a trained on Google Colab:

Open In Colab

Overview

This project applies conditional adversarial networks to colorize grayscale images. The model learns to translate grayscale images into colorful ones by training on paired datasets.

Features

  • Implemented in PyTorch
  • Supports custom datasets
  • Includes a training script and a jupyter notebook on google colab to test a trained model hosted on huggingface model hub.
  • Data augmentation and preprocessing
  • Logging to tensorboard

Training details

It has been trained with 12000 images from COCO 2017 dataset during 150 epochs with batch size 16 and learning rate 2e-4 for both generator and discriminator. Data augmentation is done by randomly flipping horizontally the images.

Installation

git clone https://github.com/yourusername/colorizing_images.git
cd colorizing_images
pip install -r requirements.txt

Usage

Training

python train.py

Results

Here are some examples of colorized images, the upper row are the generations of the model:

Example 1 Example 2

Acknowledgments

License

This project is licensed under the MIT License.

About

An implementation of the Pix2Pix paper for image colorization using PyTorch.

Topics

Resources

License

Stars

Watchers

Forks