Editor's note: The author of this article is Zhai Zhongqiang, Lei Feng network (search "Lei Feng network" public number concerned) hard to create open group friends.
The recent Prisma imaginative image filter software is very hot. This image processing application integrates artificial neural network technology and artificial intelligence technology. It can acquire the artistic styles of famous painters and major schools, and then intelligentize photos. Stylized processing transforms pictures into artistic effects.
PRISMA
So itchy, they also want to DIY out of a Prisma. Compared to APP, implementing this function on a computer is a bit more tedious, but in this way, we can:
1. Feel free to choose the image you want to convert into style;
2. Have flexible parameters that can be changed and make great efforts;
3, readers interested in the use of the Python source code can study its principles.
This is like a point-and-shoot camera and SLR. Maybe we can use the SLR to discover the deeper secrets and even more amazing works.
Introduction:
Before starting work, we will first introduce the project. The project started with a thesis "A Neural Algorithm of Artistic Style" at the University of Tübingen. In short, it learned the style of a painting through a convolutional neural network (CNN) and styled the painting. Apply to another picture.
A Neural Algorithm of Artistic Style
The CNN algorithm is the core of this, and there are many different toolkits for the implementation of the CNN algorithm. The TensorFlow configuration is relatively easy. TensorFlow is the second generation artificial intelligence learning system developed by Google based on DistBelief. Its naming derives from its own operating principle. It is easy to implement CNN, RNN and LSTM algorithms using this system. These algorithms are in the field of artificial intelligence, especially image processing. The aspect is very popular.
ready:
Before this, you need to ensure the following two conditions:
1, a computer with NVIDIA graphics card, desktop notebook can be (without graphics can also be achieved, but through the graphics card GPU acceleration efficiency can be increased by 20 times)
2, the computer is installed in the Linux operating system (preferably not a virtual machine, otherwise the drive will toss people crazy)
If you haven't contacted Linux readers, you need to be prepared for the toss. Linux drivers are not as good as Windows, and you need to find more information on the Internet.
Implementation:
1, install TensorFlow:
TensorFlow installation is relatively simple, specific installation methods can refer to the TensorFlow Chinese manual:
Http://wiki.jikexueyuan.com/project/tensorflow-en/
2, download the project:
Use Git to download the project
Git clone:https://github.com/harry19902002/image-style-transfor.git
3, download the VGG19 network model:
The VGG19 network model is a convolutional neural network structure developed by the Oxford Visual Geometry Group. It has a good visual performance, and the VGG19 network model is also needed in the project.
Download address: http://
Download it to the project directory.
4, start the conversion:
Well, the preparations are basically ready. We put the original picture and the pictures that need the learning style into the Content and Style folders in the project directory, and use the command line to enter:
Python neural_style.py --content original image filename --styles style image filename --out generated image filename
Example: python neural_style.py --content ContentFile.jpg --styles StyleFile.jpg --out OutFile.jpg
After a few minutes of processing we can find the converted file OutFile.jpg in the out folder
(processing effect chart 1)
(processing effect chart 2)
5, advanced modifications:
Of course, there are many other parameters that can be explored in the project, which may make the picture more beautiful:
such as:
--iterations Modify iterations (default is 1000)
--content_weight photo weight
--style_weight style image weights
--learning_rate learning step
More parameters can be found by entering the following code:
Python neural_style.py --help
After the show:
Because there are many adjustable parameters in the current algorithm, it is not a fully optimized state. Therefore, readers are encouraged to try out the parameters.
Of course, the simple cottage is not meaningful, so with this project, we can do something unique and Prisma can't do it completely. Here I have done two small demos to get started.
1, decomposition of computer learning process:
Before there was a netizen asking what effect this training had on the number of different results, I made a small video and generated the image without training, so that we could see the entire training process.
http://player.youku.com/embed/XMTY2NTc5NjkwMA
2, generate a style of art video:
The conversion of one picture is not enough to kill the circle of friends. No matter what, the reason for video conversion is the same. After some processing, we can convert video into artistic style:
Processing time is long, so I only made a short video, the original video address:
http://player.youku.com/embed/XNzUwNzEwNTQw
Style converted video address:
http://player.youku.com/embed/XMTY2ODA0NzE3Ng
It still looks cool.
Reference link:
[1] AI Retouching Art: The Marvelous Algorithm Behind Prisma | Depth
[2]A Neural Algorithm of Artistic Style
RJ45 plugs include unshielded RJ45 plug and shielded RJ45 plug for twisted pair solid or stranded cable, supports 24AWG, 26AWG, 28AWG, 30AWG, 32AWG round or flat Network Cable.
Gold-plated contacts provides reliable performance for a Gigabit Ethernet rated network
Save money by using these connectors to create your own patch cables.
ROHS compliant, and the color is Transparent, allow indicator light penetration better.
Easy for Carry, Gold plated connectors resist corrosion, improve the signal performance.
Rj45 Plug,Rj45 Wall Plug,Rj45 Plug Wiring,Rj45 Female Wall Socket
Shenzhen Kingwire Electronics Co., Ltd. , https://www.kingwires.com