[PYTHON] How to install richzhang / colorization on Windows 10

What is this?

This document shows you how to install Colorful Image ColorizationonWindows10andPython3.x(3.8.6).

Steps

Step 1. Install Python on Windows

Version 3.8 of Windows x86-64 executable installer seems better: https://www.python.org/downloads/windows/

Step 2. Install richzhang/colorization

Clone the repository

git clone https://github.com/richzhang/colorization.git

CUDA

Download and install CUDA 10.2: https://developer.nvidia.com/cuda-downloads

PyTorch (torch)

pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

# For more details see below
# https://stackoverflow.com/questions/56859803/modulenotfounderror-no-module-named-tools-nnwrap

Others

Please note that I chose scikit-image instead of skimage.

pip install wheel scikit-image matplotlib argparse
pip install ipython

Step 3. Run

cd colorization
python demo_release.py -i imgs/ansel_adams3.jpg

screenshot of success

Congratulations!

Logs

PyTorch (torch)

Click here to see command-line logs
C:\Users\AAA>pip install torch===1.6.0 torchvision===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html
Looking in links: https://download.pytorch.org/whl/torch_stable.html
Collecting torch===1.6.0
  Downloading https://download.pytorch.org/whl/cu102/torch-1.6.0-cp38-cp38-win_amd64.whl (1077.4 MB)
     |████████████████████████████████| 1077.4 MB 833 bytes/s
Collecting torchvision===0.7.0
  Downloading https://download.pytorch.org/whl/cu102/torchvision-0.7.0-cp38-cp38-win_amd64.whl (1.1 MB)
     |████████████████████████████████| 1.1 MB 6.8 MB/s
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
     |████████████████████████████████| 829 kB 3.2 MB/s
Collecting numpy
  Downloading numpy-1.19.2-cp38-cp38-win_amd64.whl (13.0 MB)
     |████████████████████████████████| 13.0 MB 6.8 MB/s
Collecting pillow>=4.1.1
  Downloading Pillow-8.0.0-cp38-cp38-win_amd64.whl (2.1 MB)
     |████████████████████████████████| 2.1 MB 6.4 MB/s
Using legacy 'setup.py install' for future, since package 'wheel' is not installed.
Installing collected packages: future, numpy, torch, pillow, torchvision
    Running setup.py install for future ... done
Successfully installed future-0.18.2 numpy-1.19.2 pillow-8.0.0 torch-1.6.0 torchvision-0.7.0

PIL seems to be the name used in Python 2.x, and pillow seems to be the name used in Python 3.x.

Others

Click here to see command-line logs
C:\Users\AAA>pip install wheel scikit-image matplotlib argparse
Collecting wheel
  Using cached wheel-0.35.1-py2.py3-none-any.whl (33 kB)
Collecting scikit-image
  Downloading scikit_image-0.17.2-cp38-cp38-win_amd64.whl (11.7 MB)
     |████████████████████████████████| 11.7 MB 3.3 MB/s
Collecting matplotlib
  Downloading matplotlib-3.3.2-cp38-cp38-win_amd64.whl (8.5 MB)
     |████████████████████████████████| 8.5 MB 6.4 MB/s
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Collecting scipy>=1.0.1
  Downloading scipy-1.5.3-cp38-cp38-win_amd64.whl (31.4 MB)
     |████████████████████████████████| 31.4 MB 6.4 MB/s
Collecting imageio>=2.3.0
  Downloading imageio-2.9.0-py3-none-any.whl (3.3 MB)
     |████████████████████████████████| 3.3 MB ...
Requirement already satisfied: pillow!=7.1.0,!=7.1.1,>=4.3.0 in c:\home\sdk\python38\lib\site-packages (from scikit-image) (8.0.0)
Collecting tifffile>=2019.7.26
  Downloading tifffile-2020.10.1-py3-none-any.whl (152 kB)
     |████████████████████████████████| 152 kB 6.8 MB/s
Collecting PyWavelets>=1.1.1
  Downloading PyWavelets-1.1.1-cp38-cp38-win_amd64.whl (4.3 MB)
     |████████████████████████████████| 4.3 MB 6.8 MB/s
Requirement already satisfied: numpy>=1.15.1 in c:\home\sdk\python38\lib\site-packages (from scikit-image) (1.19.2)
Collecting networkx>=2.0
  Downloading networkx-2.5-py3-none-any.whl (1.6 MB)
     |████████████████████████████████| 1.6 MB ...
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.3
  Using cached pyparsing-2.4.7-py2.py3-none-any.whl (67 kB)
Collecting certifi>=2020.06.20
  Using cached certifi-2020.6.20-py2.py3-none-any.whl (156 kB)
Collecting python-dateutil>=2.1
  Using cached python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting cycler>=0.10
  Using cached cycler-0.10.0-py2.py3-none-any.whl (6.5 kB)
Collecting kiwisolver>=1.0.1
  Downloading kiwisolver-1.2.0-cp38-none-win_amd64.whl (58 kB)
     |████████████████████████████████| 58 kB ...
Collecting decorator>=4.3.0
  Downloading decorator-4.4.2-py2.py3-none-any.whl (9.2 kB)
Collecting six>=1.5
  Using cached six-1.15.0-py2.py3-none-any.whl (10 kB)
Installing collected packages: wheel, scipy, imageio, tifffile, PyWavelets, pyparsing, certifi, six, python-dateutil, cycler, kiwisolver, matplotlib, decorator, networkx, scikit-image, argparse
Successfully installed PyWavelets-1.1.1 argparse-1.4.0 certifi-2020.6.20 cycler-0.10.0 decorator-4.4.2 imageio-2.9.0 kiwisolver-1.2.0 matplotlib-3.3.2 networkx-2.5 pyparsing-2.4.7 python-dateutil-2.8.1 scikit-image-0.17.2 scipy-1.5.3 six-1.15.0 tifffile-2020.10.1 wheel-0.35.1

c:\home\sdk\python38 is a directory name that is unique to my environment.

First run

Click here to see command-line logs
C:\home\src\colorization>python demo_release.py -i imgs/ansel_adams3.jpg
Downloading: "https://colorizers.s3.us-east-2.amazonaws.com/colorization_release_v2-9b330a0b.pth" to C:\Users\AAA/.cache\torch\hub\checkpoints\colorization_release_v2-9b330a0b.pth
100.0%
Downloading: "https://colorizers.s3.us-east-2.amazonaws.com/siggraph17-df00044c.pth" to C:\Users\AAA/.cache\torch\hub\checkpoints\siggraph17-df00044c.pth
100.0%
C:\home\sdk\python38\lib\site-packages\torch\nn\functional.py:3118: UserWarning: Default upsampling behavior when mode=bilinear is changed to align_corners=False since 0.4.0. Please specify align_corners=True if the old behavior is desired. See the documentation of nn.Upsample for details.
  warnings.warn("Default upsampling behavior when mode={} is changed "
C:\home\sdk\python38\lib\site-packages\skimage\color\colorconv.py:1128: UserWarning: Color data out of range: Z < 0 in 367 pixels
  return xyz2rgb(lab2xyz(lab, illuminant, observer))
C:\home\sdk\python38\lib\site-packages\skimage\color\colorconv.py:1128: UserWarning: Color data out of range: Z < 0 in 33 pixels
  return xyz2rgb(lab2xyz(lab, illuminant, observer))![](https://storage.googleapis.com/zenn-user-upload/owfupao294w6w9z4j0wr2w813agg)

Note

This page is a clone of the Zenn article.

Recommended Posts

How to install richzhang / colorization on Windows 10
How to install pycrypto on Windows
How to install music 21 on windows
[Kivy] How to install Kivy on Windows [Python]
How to install Python [Windows]
How to quickly install h5py on Windows 10 [Unofficial]
[Python] How to install OpenCV on Anaconda [Windows]
How to install / verify graphviz on anaconda / windows10
How to install mysql-connector-python on mac
How to use Dataiku on Windows
How to install graph-tool on macOS
How to install VMware-Tools on Linux
How to deploy django-compressor on Windows
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install Maven on CentOS
How to install Go on Ubuntu
How to install aws-session-manager-plugin on Manajro Linux
How to install drobertadams / toggl-cli on Mac
How to use Google Assistant on Windows 10
How to install packages on Alpine Linux
How to install Anisble on Amazon Linux 2
How to install Windows Subsystem For Linux
How to install Apache (httpd) on CentOS7
How to install php7.4 on Linux (Ubuntu)
How to install Eclipse GlassFish 5.1.0 on CentOS 7
How to install Apache (httpd) on CentOS8
How to install NumPy on Raspberry Pi
How to install cx_Oracle on macOS Sierra
How to install pip
How to install archlinux
How to install python
How to install BayesOpt
Install Anaconda on Windows 10
Install python on windows
Install pycuda on Windows10
Install pygraphviz on Windows 10
How to install Nbextensions
Install Chainer 1.5.0 on Windows
How to install Prover9
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
How to install OpenGM on OSX with macports
How to live a decent life on 2017 Windows
How to install Camunda Modeler on Manjaro Linux
Install Numpy on virtualenv on Windows
[2020.8 latest] How to install Python
How to embed mod_wsgi into Apache on Python Windows
Tabpy 1.0 (2020-01 version) How to install
Install cvxpy on windows, Anaconda
How to install Linux on a 32bit UEFI PC
How to install Git GUI and Gitk on CentOS
How to install caffe on OS X with macports
How to register on pypi
How to install mkl numpy
Install Chainer 1.6 (GPU) on Windows 7.
[AWS EC2] How to install Maven on Amazon Linux 2
How to install Pelican blog
How to install git on Linux such as EC2
How to run Django on IIS on a Windows server
[Python] [Chainer] [Windows] Install Chainer on Windows