pvitoria / chromagan

An Adversarial Approach for Picture Colorization

  • Public
  • 188.2K runs
  • GitHub
  • Paper
  • License

Input

Output

Run time and cost

This model runs on CPU hardware. Predictions typically complete within 1 seconds.

Readme

Image colorization using adversarial learning

Abstract

The colorization of grayscale images is an ill-posed problem, with multiple correct solutions. In this paper, we propose an adversarial learning colorization approach coupled with semantic information. A generative network is used to infer the chromaticity of a given grayscale image conditioned to semantic clues. This network is framed in an adversarial model that learns to colorize by incorporating perceptual and semantic understanding of color and class distributions. The model is trained via a fully selfsupervised strategy. Qualitative and quantitative results show the capacity of the proposed method to colorize images in a realistic way achieving state-of-the-art results.

Docker usage

Given that you have grayscale images in ./inputs, the following command will produce colorized images in ./outputs.

Run on GPU

This model requires an NVIDIA GPU, compatible with CUDA 10.0.

docker run -it --gpus all \
        -v $PWD/inputs:/code/DATASET/imagenet/test \
        -v $PWD/outputs:/code/RESULT/imagenet \
        us-docker.pkg.dev/replicate/pvitoria/chromagan:gpu

Run on CPU

docker run -it \
        -v $PWD/inputs:/code/DATASET/imagenet/test \
        -v $PWD/outputs:/code/RESULT/imagenet \
        us-docker.pkg.dev/replicate/pvitoria/chromagan:cpu

Network Architecture

Aknowledgments

The authors acknowledge partial support by MICINN/FEDER UE project, reference PGC2018-098625-B-I00 VAGS, and by H2020-MSCA-RISE-2017 project, reference 777826 NoMADS. We also thank the support of NVIDIA Corporation for the donation of GPUs used in this work.