 Okay, so this is going to be a tutorial on how to do style transfer using spell. It's from this GitHub repo by the guy who did the real-time style transfer thing that you sent me. So you can follow the instructions here, but I will run through them as well. And it references an article in spell itself about transferring style. So I'm just kind of following along with this. It requires Python and it requires pip, so if you don't have both of those things on your machine already, what you probably do, because you've got style transfer working, but if you don't have those things, you'll need to install them. You can always get a thing called Anaconda Navigator which you download from the web. You can search for Anaconda Navigator download and you can create an environment. You go create, give it a name, and then choose your Python version and create that environment. And it comes with pip install, so 19.2.3. Once you have all that stuff running, you can go make a folder on your hard drive, change directory into that folder. So I made one called gray area spell. And I've got an image I'm going to train it on in this train images directory. So you can see that here. There's my image. That's just the image from their tutorial. And now I'm going to just kind of follow along here. So pip install spell. Now it'll probably tell me it's already installed. Nope. Some kind of problem. So I have pip3 and pip. So I need to make sure that I run pip3 install spell. This only works on Python 3, I think. Which you should be running anyway. Okay, so that's installed. Let's check it by running spell. And I get a list of commands. I'm going to type spell login. And I'm going to try to remember my login. It probably won't work. Oh, there we go. We're in. Okay, so I'm going to clone this repo. Change directory into it. And just follow all those steps here. So make directory checkpoint. Touch checkpoint to ignore. Make directory images. Draw your images style. And we're going to move this image into the... I didn't say to move it. Images style. Okay, so this is the thing. This is the style we're going to want to copy. So that will be transferred onto any, you know... If somebody steps in front of the webcam, it's going to render it in that style. Right, that's probably obvious. Okay, okay. We're going to do git and... I don't know why I need to commit to git. I'm doing it. And now we're going to make a spell run. This does charge you... It's not much. Looks like it took him about an hour and a half to run this. We'll see how long it takes us. So I'm going to go ahead and get that going. And put you on pause. Okay, so what that did is download the model. It uses a data set called Cocoa. And once it gets all that stuff and extracts it to Drive, then it'll tell you it's done. And it's set this up as run for. So if I were to go into Spell, which who knows which window that's in. I see I've got a run here and it took me 36 minutes. Which is way faster than the last time it ran, which was an hour. Not sure what the difference was. Anyway, we're going to continue with the tutorial. So we've done the setup. And I'm going to paste this into a window. So I can see what I'm about to run first. Okay, so it's where it says the run number of your setup run. That is this number here for. And it says where it says your style image name. We're going to want to do images style. We call it train image. So train image.jpg. We'll leave the style weight as it is. This is a machine type K80. It says he used a V100. I'm going to use that too. Because I've used them in the past. And let's just see what that does. It's kind of like a middle of the road machine. I don't know what a K80 is. And then we just want to make sure we're in the right directory. So inside the fast style transfer folder. Yup, I'm in the right spot. Should be able to just paste this. Hit enter. And it's casting the spell. So that's going to run. And it's going to take a few hours. Okay, when it's done, you can download the results. And so I'm just going to make a inside the spell directory. Not the fast style transfer directory. I'm going to do a runs folder. And I'm going to use one of the previous runs. Since the one we just did is still running. And so let's go ahead and change into that directory. I'm just going to open up a new window. You can close this window by the way. It's fine. It's running remotely. Let us know on our machine what the status is versus having to log in online. Anyway, so change into runs three. Actually, we want to change into spell. So CD space. Drag that folder in or type in the path to wherever you saved it. And now let's try this. Spell LS runs three. Spell LS runs three. Checkpoint Spell CP runs three. Checkpoint. So it's copying 156 megabytes worth of stuff. Runs three. I don't see anything. So I got copied. Not into the runs directory. So I'll just move this in there. Runs three. Okay. Okay. So now we need to convert it into an ML5 friendly format. So I'm going to do yet another directory, which is say ML5 format. And we'll change directory into that. And we're going to clone this repo. So you got to have git installed. Not sure if you have that on your command line yet. It's just realizing. And then we're going to change directory into that new folder. So in there. And we need to install TensorFlow. So I'm going to run, in my case, pip3 install TensorFlow. And I've already got it. So it went fast. And then to test if it works, we're going to run this next command, which is pip3, er, sorry, Python three. Okay. Now it's going to say, put the checkpoint files we downloaded from Spell into the current directory. I'm going to copy this, output directory, source, checkpoints, your folder name, source, checkpoints, we'll call it, I'm just going to call it run three checkpoint file. So I'm going to paste that in here. It's going to run. And just adds up. So just to make sure that you've got everything in the right place. What it did was take the checkpoints from the non ML5 version that we ran in Spell and downloaded. And it output them into source, checkpoints, run three. Okay. So we got this folder. You need to copy it into something where we can preview this. So we're at this step running the model in ML5.js. So if you don't have this already, I'm going to go into this directory, the gray area directory for myself. Instructure to gray area. And I'm going to clone this repo, which is just like the demo app. Once it's downloaded, I'm going to transfer into it. And then I've got Python three. So I'm going to run a server here. And it's going to say copy the folder from step four and put it into model. So that was Spell, ML5 format, source, checkpoints, run three, copy that into style, transfer into style, transfer, Spell, models, run three, change, style equals models, Fushun, model loaded. So let's take a look at this in our code editor. And we'll find that line. Here it is. And ours is called run three. We just need to change it from Fushun to run three. Okay. So you can see we're running on for 8000, load this up, loading the model, get user media nuts reported in this browser. Okay. So this is because this is not a secure connection. In order to make it secure, we can either put it on a secure web server or we can run a tunnel to our local machine or you can just put it on your local version of the actual identity portal site and replace one of the existing folder names because that is already running securely. But I'm going to show you how to do this with a thing called ngrok. Follow the download instructions. This is detecting I'm on Mac. So I'm the download for Mac. But here are the Linux distributions. Unzip it somewhere and wherever you unzipped it from, you're going to create an account, run this command to get initial authorization. You only have to do this once. And then after you've created your auth token and everything like that, you're just going to run this command. Only we want to run it not at port 80, but we'll do 8000 because that's where this is. It's 8000. So I'm going to go to my terminal ngrok.htp 8000. It creates a secure tunnel. You'll copy this HTTPS URL. Open it in your browser. It's going to load our model. And now it will allow us to use the camera because we're on a secure channel. Okay, fast forward, model loaded. This is my very poorly trained and ugly style that you can see in real time. It's applying my style. Don't pay any attention to this image over here. That is obviously, you just haven't changed the website to show what style is being applied. So that's the whole process. Let me know if you have questions. Leave a comment. And good luck.