Simple neural network written in tensorflow for painting images. It works by using [x,y] coordinates of each pixel from the input image as inputs and tries to predict their respective [r,g,b] values. The generated pictures have a look of a hand-painted picture.
It took me around 18 hours on quadcore i5-4690 to paint 500 frames (20sec) of 720p video with 50 iterations and 13 layers with 24 neurons/layer, running 4 isolated scripts. It can be seen on this painted video & original video.
tensorflow
Tensorflow library.python 3.5
matplotlib
numpy
Usage is configured with config.json file that has to be in the same directory as the npaint.py script. Script will take all .jpg images from the input folder and run for num_iterations on each one before outputing the result. It can be used on videos as well, since you can extract all frames from video with ffmpeg
input_folder
path to folder where input images are locatedoutput_folder
folder where to write the output images ton_neurons
number of neurons per layeractivation_fn
activation function after each hidden layer, "relu" or "tanh" are valid optionsfinal_activation_fn
activation function of the last layern_layers
number of layersbatch_size
num_iterations
learning_rate
python3 npaint.py
Released under the MIT License.
Authored and maintained by Dušan Josipović.
Blog dulex123.github.io · GitHub @dulex123 · Twitter @josipovicd