Skip to content

lbarraga/colorization-pytorch-python3

 
 

Repository files navigation

Interactive Deep Colorization in PyTorch

note: This fork fixes some issues the original repository had with Python 3.

All credits go to Richard Zhang*, Jun-Yan Zhu*, Phillip Isola, Xinyang Geng, Angela S. Lin, Tianhe Yu, and Alexei A. Efros.

Project Page | Paper | Video | Talk | UI code

Fast start

  1. clone this repo and create a virtual environment (recommended Python 3.12):
git clone https://github.com/lbarraga/colorization-pytorch-python3.git
cd colorization-pytorch-python3
python3 -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Download the ILSVRC 2012 dataset(training images (728MB) and validation images (6.3GB)). extract the training images and put them in a folder /train. Extract the validation images and put them in a folder /val.

  2. Prepare the dataset:

python make_ilsvrc_dataset.py --in_path <folder>
  1. Download a pretrained model:
bash pretrained_models/download_siggraph_model.sh
  1. Test the model:
python test.py --name siggraph_caffemodel --how_many 10 --mask_cent 0
  1. A results folder will be created with the results of the test. You can visualize the results by opening the index.html file in the results folder.

Testing the model

To change the method currently being tested, change the function being called in add_color_patches in util.py.

You can test the model on the validation data by running the following command:

python test_sweep.py --name siggraph_caffemodel --mask_cent 0

in the code of test_sweep.py you can set the how_many flag, that has been hardcoded to something different.

in ./checkpoints/siggraph_caffemodel you will find a csv with the mean and std for each number of points, along with the plot of the test.

To visually compare the results/performance of the different models, run:

python plot.py

About

PyTorch reimplementation of Interactive Deep Colorization for Python 3

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 97.3%
  • Shell 2.7%