Hi and welcome to actually we we're in less than 24, which is near Listowel transfer, which is a very
cool concept which will illustrate shortly.
So put in this notebook here.
So what is neural cell transfer?
So firstly, this is a picture of my wife in her carnival costume because Carnival is a big part of
my culture.
Back in Trinidad and Tobago, we never miss a carnival for almost 10 years now.
So what neural cell transfer does?
It takes an original image like this here and then to take it combines it with a style image.
Style image is basically like another example of artistic image, and it creates that it takes this
image and puts it into the style of this image of of of the original style image.
So you can probably see it better when they explain it before.
This is an example of it in the shorts and here with this example.
So this is the input image here.
So this is the epidemic here.
This is a style image up here.
And we basically it uses neural networks or deep learning to extract the style from this image here.
And then it applies the style to this image and it does it iteratively using deep learning, and it
produces a really cool effect in the end with this image.
Noah has a style of that starry night painting effect that was an original style image.
So let's take a look at how we do this in Open City.
So already loaded these functions and test images and as well as a molehill molehill.
And it's just download the sample image that we're going to be testing on.
So we have seven artistic styles here, so let's take a look at his artistic style sort of directory
here.
We have these are the paintings.
So there's this one here.
Let me just make the screen a bit bigger so you can see it.
I'm going to go through all but fit is interesting.
You would do a starry night as well.
The screen is quite famous.
That's this one here with this little guy screaming so you can take a look at all the artistic styles
if you want.
Actually, let's go to all.
Let's take a look at the others in the way of.
So we have a screen you saw.
There's this one called with me.
Japanese also believe there's the muse.
It's a pretty cool one here.
Composition and weave, which I actually love this one, too, because it works quite well with the
nasty sounds for neural cell transfer algorithm.
So let's take a look at how we do this.
The first thing we pointed a model here so that the models in this directory here with all of these
artistic styles have their own model.
It's a little T7 model.
Well, which I believe is a caffee file from a mistake and torch available, perhaps because it's learning
from too much that it's not a regular pity towards miles.
So anyway, torture was sort of on coffee anyway, so we get the part to model flowerpots as well and
dressed in a saturation scroll competition.
And then we just go through each model and apply the model to our sample input image, which is a city,
which is this image here.
When we did the tilt shift effects on so we want go through all of these just yet.
See, that fall finale actually isn't really the finale of this lesson.
There's another part of this lesson to love.
But anyway, that's gone.
So let's see how we run the neural style transfer here.
So let's zoom in a bit so you can see this is a style image.
Remember, the style image is the Autobots image in this case that we're looking to apply to our city
image.
So the image being our input image, if you want to call it it.
So we know the model here.
Read from too much using the DNA to the DNA function so we can understand model here.
And then we just get to height and weight.
We resize that image.
It's moving on that and we applied model.
Actually, we know the image model here, 3D image using the bottom image.
That's then that allows it to feed it into the neural style model.
Here we just do a forward forward means we just run the input image through the model and then we get
the outputs here.
This is some standard mean subtraction we need to do for the model.
That adds because of the data so the model was trained on.
You don't need to overthink that.
Those values do this preset values that are hardcoded here that set a specific to this model and the
data was trained on it would be it would these numbers remain the same, but any image?
You want to actually execute on.
Worry about it right now.
And then we display the output.
So let's run.
This could actually run.
This really takes a minute to run.
So I'm going to run it again, but I can see the opposite.
So this is the original image.
This is the artistic image that we're applying this style to the city image and look at.
Look at it.
Well, that looks pretty good.
This looks like a real drawing in this artistic style of this image.
So I'm impressed with that.
Hope you are, too.
Let's take a look at the starry night one little less impressive, but nonetheless, it's very nice.
I like like in windows, a yellow, the mountains of that patchy, but it looks pretty cool as well.
Let's see the Andy Rooney model.
This one is pretty cool, too.
It's not perfect, but pretty cool.
Let's take a look at this one.
This one isn't as impressive because it seems to apply the texture of this art, but everywhere.
So it looks like a bit too hard to see.
But it's nonetheless.
It's pretty cool.
Let's take a look at feathers, for instance.
Generate nice images.
However, in this case, it's not that perfect.
This one actually looks looks quite wealthy with images, and you can see it looked.
It looks quite good.
It's sort of like a polygonal type art effect, and we have we have looks decent as well.
So let's go to the last one candy.
Not too bad.
Actually, that wasn't the last one.
This was the last one here, and it's quite good.
So now we're going to take a look at using an updated NASD algorithm.
So now let's take a look at the updated one of one of the many of the ads I should say to the amnesty
algorithm.
This one was called the FCC b 16 of the amnesty algorithm.
Basically, it did something called instance normalization, which which is basically when swapping
it was and then swapping the batch formalization for the instance, normalization and applying instant
normalization at which reading and testing it led to much faster real time performance and probably
better visual aesthetic performance as well.
Parents.
So the easy CV is the actual people publication where it was published.
That's the conference.
So let's take a look at implementing this so you can see we just point to the 16 folder, which has
a model.
We load the same images we did before, and then we run this model.
So let's run.
This here shouldn't take that long, since it's a fast algorithm.
And it's already starting to generate some images.
So let's take a look.
This is the dark, starry night image, which actually looks much better than the previous one, in
my opinion.
This is one.
This one looks spooky, and that is good.
We'll wait for the others to complete.
It's coming one by one.
It's this one here is the wave, which looks better than the previous one.
This one here looks quite nice and I'm quite pleased with the appearance of that one.
So that's it's finished.
No, we didn't ruin all the images in it.
So you can take a look.
Experiment with this if you want afterward.
Now, let's run this on a video, because that's pretty cool.
Imagine doing this on a video.
We basically create video and artistic style, so have a very short clip of a scene just to a couple
of seconds.
So let's do this and it's we're going to use a video writer of Believe you're familiar with this video
writer?
We've done several times before, and we're going to lower the output after this, and I just I didn't
change this yet.
There we go.
So now this is basically the same procedure as before.
And instead, now we're writing each frame now to the out video for the video input and just using a
different model inside.
And we can bring this into a starry night scene, artistic scene, artistic style, applying that to
the video, image or video of it not only video image, but a video.
For all intents and purposes, a video is just just a sequence of images.
Anyway, so let's just wait for this to complete.
Takes a bit some time, but we'll wait it out.
OK, there we go, it's finished than just over a minute.
So, no, that's converted to me before and clearly of it right here in color.
And of course, if you ever want to take a look at training your own artistic style model, take a look
at this GitHub repo here.
Let's open it up while all video converts.
So this implementation here allows you to train your own models on it, if you ever wanted to, you
could take a look at this.
It may be quite interesting for some of you if you want to get deeper into this.
So feel free to check it out.
Got 3.9 stars, so it's quite good.
So now let's go back to this.
Let's play a video here and you can see, well, it's quite short, but you can see it's a pretty cool
video.
Now, let's show you the original one probably should have used better VIDEO But this one was quite
short.
So let me just bring up the video.
So you can see it here.
That was the original video, just a quick little clip of whether it's taken too long to process, then
you can see the elephants here, which looks quite quite nice.
So that's it for neural style.
Transfer will now move on back to object to vector direction.
The reason I have the lesson split like this is because I didn't want you guys to get to board who had
one thing sort of destroying a variety of cool projects coming to the end of the open TV lectures because
we're up to 40 now and this gives us like it should give you a nice experience with how we can implement
things with open TV because obviously view is quite powerful, which is why I wanted to include it in
this course.
So stay tuned for solid state detectors, which is a not a single stage three single stage detectors,
not solid state solicitors to assess the hard drives of the strikes.
So assess these single shot detectors, which is another type of object detector like you.
So I'll see you in that lesson.
Thank you.