A few followers of mine asked me to write out a guide on how to do the types art I do on #trippythursday. I take two photos taken on tripod with my special camera, a full spectrum photo and an infrared or ultraviolet photo. Then I use a code based neural network to add colors from the full spectrum photo into the colorless infrared or ultraviolet photo. Sometimes the neural network adds colors, patterns and other interesting and psychedelic features to the otherwise colorless photo.
Background and History
This technology is similar to the "Deep Dream" project started by Google. A CAPTCHA based algorithm trained in a neural net to identify objects and superimpose them into images or videos.
https://en.wikipedia.org/wiki/DeepDream
More info on DeepDream
So Style-Transfer is technique of using these trained algorithms on an Nvidia CUDA enabled machine to analyze and superimpose what its been trained to see onto the new images. For the images I make I am currently using "NIN-Imagenet" which was designed to detect objects using a "model zoo". By it does this by looking for colors, lines, shadows and other repeatable patterns to attempt to identify what is in the photo. Using special software (Neural-style-pt), you can harness the power of this object detecting neural network to transfer style in photography.
Neural-style-pt is a Python application that runs with other dependencies to turn my black and white infrared photos into computer generated art work.
Setting up your own Neural net environment
Before starting with Python, some important tools and drivers need to be installed.
CUDA Toolkit and compatible video card.
A list of video cards that support such drivers: https://developer.nvidia.com/cuda-gpus
Miniconda
https://docs.conda.io/en/latest/miniconda.html
Anaconda is a full distribution of Python itself along with the binaries for several hundred third-party open-source projects. Miniconda is just an installer for an empty conda environment, containing only Conda, its dependencies, and Python.
After installing both, verify they are working in the terminal.
Check the CUDA version to make sure its functioning.
nvcc --version
Download Neural-Style-pt from Github
https://github.com/ProGamerGov/neural-style-pt/archive/master.zip
Extract and Create two folders. Style and Content.
Content Will be used for the black and white infrared photos in my case. But consider these the base photos.
Style Is used to "Stylize" the content photos, adding what the Neural network things should be in the content photo.
Navigate to the downloaded Neural-Style-pt in terminal by using CD. Then test Conda:
conda create -n neural-style-pt python=3
activate neural-style-pt
conda install tensorflow scipy pillow
Once the above commands are run you should have tested Conda and verified you have CUDA up and running.
Install the models, which are the trained neural networks that will be used to transfer style from the style to the content
You do this by running the download_models.py which will download VGG16, VGG19 and NIN-Imagenet.
If all went well you are ready to run Neural-Style-pt
While in the terminal enter the following command tailor it to your modelcontent style and out directory paths.
python neural_style.py -style_image C:/neuralstylept/style/picasso_selfport1907.jpg -content_image C:/neuralstylept/content/brad_pitt.jpg -output_image C:/neuralstylept/Out/profile.png -model_file models/nin_imagenet.pth -gpu 0 -backend cudnn -num_iterations 1000 -seed 123 -content_layers relu0,relu3,relu7,relu12 -style_layers relu0,relu3,relu7,relu12 -content_weight 10 -style_weight 500 -image_size 512 -optimizer adam
If you get an out of memory error you may need to decrease the image_size value. But if you have a big beefy video card you can increase it past 2000.
Running the python script looks like the above
As the python app runs it will create iterations in the Out folder. And after 10 or so the image should appear more than just some psychedelic patterns.
With a successful render the image should have colors added to it from the full spectrum image into the new image. Though sometimes the colors may be slightly different and placement can be a little off so has its own unique look to the image.
This Python script can do alot more than just what I am currently doing with it. You can stylize pictures taken in real life with artwork to get very unique effects.
I plan to run many of my photos taken through this Python script using art as the style photo, so far above is what I have come out with.
The possibilities are limitless with this tool, with the variety that occurs in art the merges would be countless with amazing results.
Addresses below to help me buy better camera equipment and support me to travel to locations to do photo and video and overall great blogs in new places. I would be happy to list some of the contributors in my posts for donations that help me along the way.
Coin
Address
BTC:
bc1qhfmvd2gywg4fvrgy2kkkkyqta0g86whkt7j8r7
LTC:
ltc1qdyzm5cwgt8e2373prx67yye6y9ewk0l8jf3ys9
DASH:
XkSqR5DxQL3wy4kNbjqDbgbMYNih3a7ZcM
ETH:
0x045f409dAe14338669730078201888636B047DC3
DOGE:
DSoekC21AKSZHAcV9vqR8yYefrh8XcX92Z
ZEN:
znW9mh62WDSCeBXxnVLCETMx59Ho446HJgq
Platform
URL/Username
Steem
https://steempeak.com/@solominer
D.Tube
https://d.tube/#!/c/solominer
Weku
https://main.weku.io/@solominer
Bit.Tube
https://bit.tube/solominer
Mithril
Solominer
Discord
Solominer#4248
Bitcointalk
https://bitcointalk.org/index.php?action=profile;u=83228
CryptoPanic
https://cryptopanic.com/solominer
Whaleshares
https://whaleshares.io/@solominer
Bearshares
https://bearshares.com/@solominer