Welcome back ​ Style transfer is cool.
And looks like magic to me.​ OpenVINO can help you
perform style-transfer in real time.​ On your laptop or any regular hardware​
It will take me only few minutes to explain how it works​
To show you a jupyter notebook you can run right away​
And how to build a real-time style transfer demo in few minutes.​
At the basis of our ability to perform generative AI​
and manipulate or generate images is our ability to represent an image in its features space.​
The first layers of neural networks like VGG16 and
others are built to extract the features of the image​
And by that create a representation of the image in the feature or latent space..​
It’s a lot like taking an image to the frequency domain, ​
VGG for example extract features of the image at multiple levels ​
Each new layer extract finer grain features, think about higher frequency​
The result is a representation of the image in the features space..​
There are multiple reasons to move to the features space, ​
It is usually smaller, it can be even 50X or smaller than the pixels space​
And it is usually invariant to all kind of transformations in the pixel domain..​
So if you move this dog image by 2 pixels, rotate it a little or scale it, ​
it’s a totally different image in the pixels domain, but not in the features space..​
Different contents, will have different features map, the content is different​
But it appears that the style of the image is also decoded in the feature space​
There are certain features that indicates the style of the image
and others that represent the content itself​
So if we take a content image and extract its features​
And extract the same features from a style image​
We can now build a loss function for the style and a loss function for the content.​
Enough content features will allow us to still recognize the image,​
Enough style features will make it looks like the style we chose.​
The easiest way to try it out is using a jupyter notebooks,​
Look for the openvino notebooks,​ Right here​
You can scroll down and look at them all.​
But I will go to the notebooks and all the way to 404.​
Yes, not the great choice of number for the internet.​
But here is the notebook and I will just run the binder​
It takes a while to load, but save you all the installations..​
And here we are.​ Just follow the steps one by one.​
Initialize,​ Choose the style,
and you can bring your own style model..​ A lot of computer vision to prepare the images ​
Load the model, convert to IR, and prepare everything​
At the end of the day it looks like a regular model ​
And it works, on a web cam, or here on a video​ Pretty cool​
If you are looking for a fast C++ demo, ​ Look for my other video on the open model
zoo demos.. And how to build the C++ demos.. It’s pretty easy​
Look for the openvino documentation​ I’ll leave you the link below.​
open model zoo demos, ​ And image-processing C++ demos.​
One of the things this demo do is style transfer​
You can read all about it here, ​ Supported models and how to run it​
I’ll be running the image processing demo​
Mosaic style model,​ I need style transfer and this is my sample video​
And it’s running pretty smooth on my integrated GPU, but also on my CPU​
And I’ll run the same demo on my web-cam​
As you can see, I am not shaved, but I still have lots of style..​
I just tried several different styles, choose your preferred style​
And that’s all​ Generative AI, style transfer, in real time,
using OpenVINO on a regular machine,​ No need for fancy GPUs or anything​
Enjoy, subscribe​ Thank you​