make black /white pictures colorful [debian, ubuntu, raspberrypi]

based on:
https://www.youtube.com/watch?v=xLcX9tYsHDc
http://hi.cs.waseda.ac.jp/~iizuka/projects/colorization/en/
https://github.com/satoshiiizuka/siggraph2016_colorization
install Torch7:
http://torch.ch/docs/getting-started.html#_

you can simply first test it here:
https://colorize.dev.kaisou.misosi.ru

install:
git clone https://github.com/torch/distro.git ~/torch --recursive
cd ~/torch; bash install-deps;
./install.sh
cd ~/torch;source ~/.bashrc
cd ~/
git clone https://github.com/satoshiiizuka/siggraph2016_colorization
cd ~/siggraph2016_colorization
./download_model.sh

https://github.com/torch/nn/issues/803
cd
luarocks install nn
luarocks install dpnn

usage:
cd ~/siggraph2016_colorization
th colorize.lua Eingabe.png Ausgabe.png

or:
cd
git clone https://github.com/zeruniverse/neural-colorization
cd ~/neural-colorization
wget -O model.t7 "https://github.com/zeruniverse/neural-colorization/releases/download/1.0/places2.t7"

usage:
cd ~/neural-colorization
th colorize.lua -model model.t7 -input_image input.jpg -output_image output.png -gpu 0

if you ever need to uninstall torch, simply run the command:
rm -rf ~/torch

mkdir ~/pics
cd ~/pics
wget http://gelsenkirchen-resse.de/wp-content/uploads/2017/02/FS-V-023399-1.jpg

cd
touch color.sh
chmod +x color.sh
nano color.sh

#!/bin/bash
mkdir -p ~/pics/colorpics
for filename in ~/pics/*.jpg; do
#for filename in ~/pics/*.jpeg; do
#for filename in ~/pics/*; do
    cd ~/siggraph2016_colorization
    echo ~/pics/colorpics/color_$(basename $filename)
    th colorize.lua $filename ~/pics/colorpics/color_$(basename $filename)
done

./color.sh

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.