pvitoria / chromagan

An Adversarial Approach for Picture Colorization

  • Public
  • 337.8K runs
  • GitHub
  • Paper
  • License

😵 Uh oh! This model can't be run on Replicate because it was built with a version of Cog or Python that is no longer supported. Consider opening an issue on the model's GitHub repository to see if it can be updated to use a recent version of Cog. If you need any help, please Contact us about it.

Run time and cost

This model costs approximately $0.00010 to run on Replicate, or 10000 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker.

This model runs on CPU hardware. Predictions typically complete within 1 seconds. The predict time for this model varies significantly based on the inputs.

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.