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-gpuif 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/originaldirectory -
Run
main.pyscript fromsrc/image_colorization/directory.python -m src.image_colorization.main --model <model name>Parameter
--methodis optional, if not presentreg_full_modelis default. It can be choose from this list:reg_full_model(default)reg_full_vgg_modelreg_part_modelclass_weights_modelclass_wo_weights_model
-
You can find colored images in
/data/image/colorizeddirectory.
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/originaldirectory -
Run
video_colorizer.pyscript fromsrc/video_colorization/directory.python -m src.video_colorization.video_colorizerVideo colorizer is always using
reg_full_model. -
You can find colored videos in
/data/video/colorizeddirectory.
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.