Neural style transfers with cv2 using a pre-trained torch model
In this section, we will discuss how to use deep learning to implement a neural style transfer(NST). You will be surprised at the kind of artistic images we can generate using it. Before diving into further details about the deep learning model, let's discuss some of the basic concepts.
Understanding the NST algorithm
The NST algorithm was first revealed in a paper on the subject by Gatys et alia in 2015. This technique involves a lot of fun! I am sure you will love implementing this, and will be amazed at the outputs that you'll create.
It attempts to merge two images based on the following parameters:
- A content image (C)
- A style image (S)
The NST algorithm uses these parameters to create a third, generated image (G). The generated image G combines the content of the image C with the style of image S.
Here is an example of what we will actually be doing:
Surprised? I hope you liked the filter applied on the Mona Lisa! Excited to...