How To Install DragGAN - Futuristic AI Image Manipulation (Never Seen Anything Like This!)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
it allows you to take any image select two points or more and the image will automatically be manipulated to fit those points drag your Gan has finally been released the actual code for it and you can use it right now on your computer it's not easy the documentation is wrong in many areas the setup script is broken and overall it's quite buggy but I figured it out and I'm going to show you how to do it let's go this video is brought to you by rosebud rosebud is an AI powered journally app that helps you self-reflect and create a personalized path to fulfillment I focus a lot on my mental health and one of the best things that I've done for that is journaling I use Rosebud and I encourage you to try it out click the link in the description to start journaling today with Rosebud now if you remember here's the demo of drag your Gan it allows you to take any image select two points or more and the image will automatically be manipulated to fit those points look at some of these examples it's pretty cool they also provide lab version which of course I can't get to work so I'm excited for the open source Community to really get their hands on this and get it in a much more stable state but for now we're gonna get it working so we're gonna need conda installed and of course if you've walked through any of my previous videos you know I love conda and you should have it installed if you don't go ahead and Google how to install conda and get that installed and conda just makes it super easy for us to manage python environments now in this tutorial I'm going to be using my Mac but I also got it working on Windows in a very similar way so you should for the most part be able to follow along on Windows now I can tell already since I've been testing this they're updating the documentation because because there was an incorrect Command right here and it was broken from the get-go now I figured this out but they've already updated the documentation so that's great we're going to scroll to the top of the page we're gonna find this little green code button we're going to click it and we're going to copy the URL found here switch back to your terminal then we're going to clone the repository and then then hit enter once you do that you're going to change directory into drag Gan so the first thing we're going to do is set up the new conda environment and the authors were kind enough to create an environment.yml file that sets up everything for us now now previously they tried to include setting the python version from this command but that didn't work so I'm glad that they updated the documentation now let's run this conda end create-f environment.yml enter and you're going to see the first issue so it says resolve package not found these are two packages that it cannot find so to fix this we're going to open a visual studio code now from Visual Studio code open up the drag Gan folder and then we're going to open up the environment.yml file the first thing you need to do is delete the Cuda toolkit line that's line 14 in the current version just delete that all together and we won't need the Cuda toolkit for Mac because that's for NVIDIA graphics cards only now if you're running this on Windows make sure to to install the Cuda tool kit 11.1 is the version that they recommend and I couldn't get that to work I couldn't actually find that version so you can use version 11.3.1 I believe it is and of course you can also use the Cuda command to find out which versions are available the next thing we have to do is remove the scipy line from the dependencies and then put it down in the PIP area of the dependencies now you do have to change one thing rather than a single equals you have to make it a double equals and then save then we're going to run this again conda end create Dash F environment.yml all right it's finished so now we're going to activate the environment conda activate stylegan3 that is the name that the environment.yml file gave us and then we just hit enter and we know it's activated because it shows it right there switching back to the GitHub repo we're going to do pip install Dash R requirements but that is also wrong because it needs to be requirements.txt I hope they update the documentation with that so we're going to add the txt on the end pip install Dash r requirements.txt enter okay and it looks like we got a little error but I think we can ignore that if I remember correctly now the next thing we have to do is enable fallbacks for MPS MPS is basically Apple's version of Cuda it allows you to use the GPU to power a lot of this but it doesn't work right now so we have to make sure we're able to fall back and use the CPU so to do that we're going to export this variable export Pi torch enable MPS fallback equals one enter next we have to download the pre-trained models so to do that we're going to type Python scripts slash downloadmodel dot Pi hit enter and this one should work no problem this may take a little while because these models are pretty big and I should mention they have models for different types of subjects of the images so they have one for dogs for horses for humans and that's really important as you're selecting the image you want to use you want to make sure you have the associated model for it that's the way to get it to work best so we can see here it's downloading one for lions for dogs horses elephant offense okay there it's done switching back to the GitHub repo switching back to the GitHub repo to run the GUI we run sh scripts slash gui.sh now I couldn't get this to work there's currently an open issue with a lot of people who are experiencing the same thing let me show you what happens so I try to run it and I get this segmentation fault along with python 3.9 quit unexpectedly so I get that every single time I try to run it it is an open issue so hopefully they fix it soon the workaround for that is to run this python gradio visualizer so it's python visualizer underscore drag underscore radio dot pi and then just hit enter and there it is running on local URL so we're going to highlight this URL right here I'm going to copy it and then we're going to switch over to it and so here it is this is running on my local machine draggan now in the top left you can see the pre-trained models available you can try out different ones horses elephants Lions dogs they have humans cats car I think they have a gen realize one as well you can have different settings and I haven't played around with these settings much I'm just trying to get this to work so let's test it out so let's say I want to take this lion I want it to start right there and I'm gonna pull her head down to there so then I'm going to click Start and there it goes how cool is that and it tells you the step number it's on and if we switch back to terminal we can actually see each step running now another bug that I ran into is once it goes over step 100 it stops incrementing and if we switch back the steps are still incrementing so nothing is changing anymore so I'm not sure if it's actually working or not so previously I've just stopped it but I'll let it go a little while longer to see if it does stop at a certain step but this definitely worked you saw the head moving and it looks fantastic now I should also mention when I got this working on my Windows machine it was clear that my GPU was not powering it it was just the CPU so I'm still trying to figure out how to get this to work fully with a GPU on Windows and right now metal on OS X doesn't seem to be working either alright so the steps keep incrementing I don't know when it's going to end so I'm just going to go ahead and click stop then you can download it by clicking this button right here and there's the new image right there now to remove the points you just click this reset points and it's right there so let's try one more thing I want her face to move in where it's a little bit more let's run it there it is moving that's so cool and look now she's even sitting and she's standing back up so awesome so I'll go ahead and click stop there and let's try the cat now here's a cat I want the cat's eye to be open a little bit more start and there it is working so so cool all right next I'll hit stop let's try one more and here's the human ffhq is the human one so let's say I want a bigger smile and I want the head to rotate this way a little bit let's see if that works yep there it goes bigger smile you can start to see the bottom teeth a little bit more now I don't see her head turning yet so I don't know if I just leave it on it'll continue to do it but let's see I'm going to click stop I'm going to reset the points and I'm going to try to turn her head this way start now this doesn't seem to be working so let me stop it I'm going to reset the points again and I'm gonna see what happens if I open the bottom lip a little bit like that start now this is definitely working a much bigger smile a little bit creepy to be honest but it seems to work really really well look at that alright so now you know how to get it installed you know how to get it working you know how to play around with it as soon as this becomes more stable I'll probably put together another tutorial video about how to use it but for now play with it let me know what you think if you'd like this video please consider giving me a like And subscribe and I'll see you in the next one
Info
Channel: Matthew Berman
Views: 25,908
Rating: undefined out of 5
Keywords: draggan, drag your gan, drag gan, ai, artificial intelligence, ai art, generative art, draggan ai, draggan ai tool, draggan colab, drag gan ai
Id: i7cI3C6_x78
Channel Id: undefined
Length: 9min 1sec (541 seconds)
Published: Tue Jul 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.