All Projects → richzhang → Colorization Pytorch

richzhang / Colorization Pytorch

Licence: mit
PyTorch reimplementation of Interactive Deep Colorization

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Colorization Pytorch

Anime4k
A High-Quality Real Time Upscaler for Anime Video
Stars: ✭ 14,083 (+3036.53%)
Mutual labels:  computer-graphics, convolutional-neural-networks
Meshcnn
Convolutional Neural Network for 3D meshes in PyTorch
Stars: ✭ 1,032 (+129.84%)
Mutual labels:  computer-graphics, convolutional-neural-networks
Fssgi
Exploratory Project on Fast Screen Space Global Illumination
Stars: ✭ 22 (-95.1%)
Mutual labels:  computer-graphics, convolutional-neural-networks
Mvcnn
Multi-view CNN (MVCNN) for shape recognition
Stars: ✭ 285 (-36.53%)
Mutual labels:  computer-graphics, convolutional-neural-networks
Slimming
Learning Efficient Convolutional Networks through Network Slimming, In ICCV 2017.
Stars: ✭ 414 (-7.8%)
Mutual labels:  convolutional-neural-networks
Deep Convolution Stock Technical Analysis
Uses Deep Convolutional Neural Networks (CNNs) to model the stock market using technical analysis. Predicts the future trend of stock selections.
Stars: ✭ 407 (-9.35%)
Mutual labels:  convolutional-neural-networks
Tf Pose Estimation
Deep Pose Estimation implemented using Tensorflow with Custom Architectures for fast inference.
Stars: ✭ 3,856 (+758.8%)
Mutual labels:  convolutional-neural-networks
Vectiler
A vector tile, terrain and city 3d model builder and exporter
Stars: ✭ 394 (-12.25%)
Mutual labels:  computer-graphics
Spatio Temporal Paper List
Spatio-temporal modeling 论文列表(主要是graph convolution相关)
Stars: ✭ 447 (-0.45%)
Mutual labels:  convolutional-neural-networks
O Cnn
O-CNN: Octree-based Convolutional Neural Networks for 3D Shape Analysis
Stars: ✭ 432 (-3.79%)
Mutual labels:  convolutional-neural-networks
Pixelcraft
A Pixel Art Editor
Stars: ✭ 413 (-8.02%)
Mutual labels:  computer-graphics
Awesome Image Translation
A collection of awesome resources image-to-image translation.
Stars: ✭ 408 (-9.13%)
Mutual labels:  computer-graphics
Deepconvsep
Deep Convolutional Neural Networks for Musical Source Separation
Stars: ✭ 424 (-5.57%)
Mutual labels:  convolutional-neural-networks
Computer Vision
Programming Assignments and Lectures for Stanford's CS 231: Convolutional Neural Networks for Visual Recognition
Stars: ✭ 408 (-9.13%)
Mutual labels:  convolutional-neural-networks
Numpycnn
Building Convolutional Neural Networks From Scratch using NumPy
Stars: ✭ 436 (-2.9%)
Mutual labels:  convolutional-neural-networks
Graphwaveletneuralnetwork
A PyTorch implementation of "Graph Wavelet Neural Network" (ICLR 2019)
Stars: ✭ 404 (-10.02%)
Mutual labels:  convolutional-neural-networks
Towr
A light-weight, Eigen-based C++ library for trajectory optimization for legged robots.
Stars: ✭ 410 (-8.69%)
Mutual labels:  computer-graphics
Lifting From The Deep Release
Implementation of "Lifting from the Deep: Convolutional 3D Pose Estimation from a Single Image"
Stars: ✭ 425 (-5.35%)
Mutual labels:  convolutional-neural-networks
Multi Class Text Classification Cnn
Classify Kaggle Consumer Finance Complaints into 11 classes. Build the model with CNN (Convolutional Neural Network) and Word Embeddings on Tensorflow.
Stars: ✭ 410 (-8.69%)
Mutual labels:  convolutional-neural-networks
Cinolib
A generic programming header only C++ library for processing polygonal and polyhedral meshes
Stars: ✭ 407 (-9.35%)
Mutual labels:  computer-graphics

Interactive Deep Colorization in PyTorch

Project Page | Paper | Video | Talk | UI code

Real-Time User-Guided Image Colorization with Learned Deep Priors.
Richard Zhang*, Jun-Yan Zhu*, Phillip Isola, Xinyang Geng, Angela S. Lin, Tianhe Yu, and Alexei A. Efros.
In ACM Transactions on Graphics (SIGGRAPH 2017).

This is our PyTorch reimplementation for interactive image colorization, written by Richard Zhang and Jun-Yan Zhu.

This repository contains training usage. The original, official GitHub repo (with an interactive GUI, and originally Caffe backend) is here. The official repo has been updated to support PyTorch models on the backend, which can be trained in this repository.

Prerequisites

  • Linux or macOS
  • Python 2 or 3
  • CPU or NVIDIA GPU + CUDA CuDNN

Getting Started

Installation

pip install -r requirements.txt
  • Clone this repo:
git clone https://github.com/richzhang/colorization-pytorch
cd colorization-pytorch

Dataset preparation

  • Download the ILSVRC 2012 dataset and run the following script to prepare data python make_ilsvrc_dataset.py --in_path /PATH/TO/ILSVRC12. This will make symlinks into the training set, and divide the ILSVRC validation set into validation and test splits for colorization.

Training interactive colorization

  • Train a model: bash ./scripts/train_siggraph.sh. This is a 2 stage training process. First, the network is trained for automatic colorization using classification loss. Results are in ./checkpoints/siggraph_class. Then, the network is fine-tuned for interactive colorization using regression loss. Final results are in ./checkpoints/siggraph_reg2.

  • To view training results and loss plots, run python -m visdom.server and click the URL http://localhost:8097. The following values are monitored:

    • G_CE is a cross-entropy loss between predicted color distribution and ground truth color.
    • G_entr is the entropy of the predicted distribution.
    • G_entr_hint is the entropy of the predicted distribution at points where a color hint is given.
    • G_L1_max is the L1 distance between the ground truth color and argmax of the predicted color distribution.
    • G_L1_mean is the L1 distance between the ground truth color and mean of the predicted color distribution.
    • G_L1_reg is the L1 distance between the ground truth color and the predicted color.
    • G_fake_real is the L1 distance between the predicted color and the ground truth color (in locations where a hint is given).
    • G_fake_hint is the L1 distance between the predicted color and the input hint color (in locations where a hint is given). It's a measure of how much the network "trusts" the input hint.
    • G_real_hint is the L1 distance between the ground truth color and the input hint color (in locations where a hint is given).

Testing interactive colorization

  • Get a model. Either:

    • (1) download the pretrained model by running bash pretrained_models/download_siggraph_model.sh, which will give you a few models.
      • Original caffe weights [Recommended] ./checkpoints/siggraph_caffemodel/latest_net_G.pth is the original caffemodel weights, converted to PyTorch. It is recommended. Be sure to set --mask_cent 0 when running it.
      • Retrained model: ./checkpoints/siggraph_retrained/latest_net_G.pth. The model achieves better PSNR but performs qualitatively differently. Note that this repository is an approximate reimplementation of the siggraph paper.
    • (2) train your own model (as described in the section above), which will leave a model in ./checkpoints/siggraph_reg2/latest_net_G.pth
  • Test the model on validation data:

    • python test.py --name siggraph_caffemodel --mask_cent 0 for original caffemodel weights
    • python test.py --name siggraph_retrained for retrained weights.
    • python test.py --name siggraph_reg2 if you retrained your own model The test results will be saved to an HTML file in ./results/[[NAME]]/latest_val/index.html. For each image in the validation set, it will test (1) automatic colorization, (2) interactive colorization with a few random hints, and (3) interactive colorization with lots of random hints.
  • Test the model by making PSNR vs. the number of hints plot: python test_sweep.py --name [[NAME]]. This plot was used in Figure 6 of the paper. This test randomly reveals 6x6 color hint patches to the network and sees how accurate the colorization is with respect to the ground truth.

  • Test the model interactively with the original official repository. Follow installation instructions in that repo and run python ideepcolor.py --backend pytorch --color_model [[PTH/TO/MODEL]] --dist_model [[PTH/TO/MODEL]].

Citation

If you use this code for your research, please cite our paper:

@article{zhang2017real,
  title={Real-Time User-Guided Image Colorization with Learned Deep Priors},
  author={Zhang, Richard and Zhu, Jun-Yan and Isola, Phillip and Geng, Xinyang and Lin, Angela S and Yu, Tianhe and Efros, Alexei A},
  journal={ACM Transactions on Graphics (TOG)},
  volume={9},
  number={4},
  year={2017},
  publisher={ACM}
}

Acknowledgments

This code borrows heavily from the pytorch-CycleGAN repository.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].