Image and video colorizer is package for automatic image and video colorization. Models are already trained.
Installation can be done in 5 easy steps
Install all requirements for Tensorflow and tensorflow itself with:
pip install tensorflow-gpu
if you use GPU device for computation otherwise:
pip install tensorflow
Create virtual environment
virtualenv -p python3 colorization_venv
Activate virtual environment
source colorization_venv/bin/activate
Clone Image and video colorization package and move in it
git clone https://github.com/PrimozGodec/ImageColorization.git
cd ImageColorization
Install requirements
pip install -r requirements.txt
You are done :)
In case you do not have a GPU device in your computer, please install Tensorflow for a CPU. Instructions are at the Tnesorflow website.
For automatic image colorizing follow those steps:
Copy images into /data/image/original
directory
Run main.py
script from src/image_colorization/
directory.
python -m src.image_colorization.main --model <model name>
Parameter --method
is optional, if not present reg_full_model
is default.
It can be choose from this list:
reg_full_model
(default)reg_full_vgg_model
reg_part_model
class_weights_model
class_wo_weights_model
You can find colored images in /data/image/colorized
directory.
on your GPU or CPU specifications. You will see progress bar that show you how far you are with colorization.
For automatic video colorizing follow those steps:
Copy images into /data/video/original
directory
Run video_colorizer.py
script from src/video_colorization/
directory.
python -m src.video_colorization.video_colorizer
Video colorizer is always using reg_full_model
.
You can find colored videos in /data/video/colorized
directory.
Colorization take few hours since there is a lot of images to color in a video and depends on your GPU or CPU specifications and length of a video. You will see progress bar that show you how far you are with colorization.