How to install OpenCV with CUDA GPU in windows 10 | Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone this is Ashwin here in this video we are going to see about how to install Coda for NVIDIA GPU and its supported modules and also we are going to see how to install opencv with Coda support I will just walk you through a simple steps to install Coda coder toolkit for NVIDIA graphic card and after that we will see how to install opencv with Coda support so the importance of this module is very much depends on the image processing so in the next video we will be uh saying about how to use super resolution on local quality images so for these things uh GPU is always faster than CPU that's why we are gonna do this so I'll just go through step by step if you have any queries so just pause the video and follow step by step and I'll also share you all the links in the description so it will be easy for you to go through so the first step is to install Microsoft Visual Studio so this is the website if you go down you can see uh three editions so download this Community Edition and install it so after doing the installation you can see Visual Studio installer this is also like fine you can also download this and install this let's open that so this will install all the necessary uh C C plus plus uh modules that is required so install this uh build tools and also install this Microsoft Studio Community both will be needed so after uh installing both of these things uh you would just go to this build tools I'll just click on modify I already installed all the modules by the way so this is that uh desktop development with C plus plus so this has like all the important modules like uh msbc C make Ms build so all these are like important uh modules if you want you can install other modules as well but this is important just uh check this and install while downloading so it will just install all the necessary modules for you now after this is done uh Community you just install it in the final step we will just use this community for compiling the modules so this is the first step you have to complete so after this we will install uh Coda toolkit with Koda DNN so go to Anaconda prompt just run as administrator and this is the command conda install C Conta Forge Coda toolkit 11.2 and qdnn so these two modules are necessary usually we will just manually download and install everything but this is a easier way just uh install it so if you don't have Anaconda means uh go to this Anaconda website and you can directly download the distribution if even if you are in other Oasis means you can just click on the supporting OS and download it after installing you can easily use this prompt if you want you can also create environment if you want to like install it in a separate environment but I just installed everything in my base environment so this is the command so it this will install all the necessary libraries that is required for your Nvidia GPU and apart from that I hope you already installed all the graphic drivers as well so that is also needed so once the installation is done we will go to the next step so the next step is uh downloading this cmake Library so this is just a installer you can download it for Windows here just clicking on this and this will just download and this is the link uh this is used for compiling the opencv and uh with Coda support so far we have completed how to uh install Coda for NVIDIA GPU now we are starting for installation of opencv with Coda support so this is the first module and the second one is opencv itself so you can download the opencv just download the resource sources file so this is the file we are going to like compile I have downloaded like 4.5.5 that is the version I have downloaded before just for uh testing purpose so you can download the latest version as well so it won't cause any issues so this is the base package that is necessary and apart from that we have this opencv Con trip so this contains some additional modules that will be needing in future projects as well so you can just click on this and download it as a zip so that uh so that are the necessary uh packages that we need so these three we will see it in the folder so these are the three things we already seen so this is opencv this is that opencv con trip and this is that uh cmake just double click on this installer and it will walk you through the steps for uh installing this cmake I already installed this so after installation if you just uh press on start and go for cmake it will show you this GUI we can go through this later and after installing this just extract both of these things in some place I have extracted both these things in my C drive so this is after extracting so these are the files for contrib and these are the files for opencv so for testing purpose I'll just create a new folder here called build now I will just open the cmake so this is the window you will be getting so here uh you can specify the source code that is uh opencv that we have downloaded before so here we have this opencv if you have 4.7 version means you can just click on this and select folder and where to build the libraries we already created a new folder called build I just already created a opencv and build folder so there only I have built all the libraries but you can just uh for this experiment purpose I'll just choose this folder so I'll just click on this folder and build now click on this configure now you can see Visual Studio 16 2019 version just check the version you have Visual Studio 2019 only so select that if you have different version select the version accordingly and here you have this optional parameter that will be you can select x64 depends on the generator and just click on finish so this will just uh compile a few things so don't worry about this messages now it is just trying to perform some test now we have like wait for a while until uh this gets completed so now after uh generating all these things uh it is showing like configuration is done now we have to like enable few things in this settings I'll just scroll this down a little okay now in the search just enable these things one by one with with Cuda opencv DNN coda enable fast math build open CV world open CV DNN so this is already enabled now open CV python so this is also already enabled next we have this contrary files right that is like extra modules so opencv extra modules path here you have to specify the path here open CV so this is not the folder con trip modules so this is the path we have to specify so after specifying the part it will show like this now that we have enabled all the basic modules again click on this configure so here you can see this Cuda detected 11.0 so this is the version we have installed before if you don't install Coda and trying to try to install this opencv with Coda support means so it will uh show you some error and if you don't have any GPU at all means so you can directly install opencv using a pip install opencv python so that is also possible but this particular tutorial is completely focused on how to install opencv with Coda support so it's just generating all the necessary modules that's needed so again it's showing like configuration is done now again we have to enable few things Coda fast math and uh coda Arts bin so this contains like various versions So currently I am using a Nvidia 1050 TI so if you have a different GPU means you have to find your particular version you can find it Nvidia coda gpus so this is the coda compatibility uh this will give you the versions so here I can see Coda enabled GeForce and Titan products click on this and you can see all the GPU version so let me just search for 1050 TI okay 1050 is here I okay ta is not there but 1050 TI is 6.1 version only if you have like a different version means just mention the version accordingly and this is the website for that let's again go to this and select everything I'll just select 6.1 alone and that is done this is the last one see make configuration type just change it to release that's pretty much it just configure it again so this is the last configuration once this is done without any errors we will just click on generate so now that everything is done you just click on this generate now you can see a message generating is done now this process is over now we have like a final step to install all the build files that we have generated so far if you just minimize this and go to the C drive in the build folder you can see a lot of files so initially it was like an empty folder now from here we have to install the modules so I'll just open command prompt CMD so here if you say C make it will give you all the commands so from cmake only we are going to build it so C make build we have to specify the folder so I have created on C build so this is the folder name so C colon backslash build and Target install and config will be release so this is the command if you just click on enter it will take a longer time to install everything so this will take around 45 minutes to an hour it depends on your Hardware also so so that's the estimated time I don't want to like wait for that time I already installed everything so this is the complete Command and only thing will be changing is the path if you are installing in a different path means just uh give the correct path here and click enter and it will take some time and everything will be done so once all these things are done we can check the version so just go to python import CV2 CV2 version now you can see 4.5.5 so that is the version I have installed so if you have a different version means uh just check whether that version is installed or not and apart from that I also have a separate file to test whether it is working or not so this is the file so this is the code for that so this is completely optional once that version is displaying means everything is like working fine for you and this is just for comparison between how much time is taking in GPU and how much time it is sick taking in a CPU so just pass the video and try to like replicate this code if possible and click on run so I already ran this before so you can see the difference it's like taking 0.5 and 2. let's rerun it again sometimes uh there will be some IO delay okay yeah it is uh giving around like uh 0.5 seconds that is faster in uh GPU but in CPU it's taking around two seconds because of the background process I am running so this is like four times Improvement uh comparatively uh comparing with GPU and CPU So based on this uh you can clearly observe that we have installed opencv without any issues so here you can clearly see write a CV dot Coda dot gem so that is the only different other than that all the commands will be uh same only so there is not much of a difference here and that's pretty much it guys uh if you have any queries about installation of this uh that's pretty much it guys if you have any queries about this installation steps please leave a comment below I'll definitely try to answer that and this is some important steps if you like install all these modules means you will have like a good environment setup because all the necessary uh modules would have been installed after this so in the next video we will be uh going for uh some opencv project that can increase the resolution of low quality images we will see that in the next video apart from that if you like this video hit the like button and don't forget to subscribe the channel for more videos like this stay tuned for the next video
Info
Channel: Hackers Realm
Views: 11,508
Rating: undefined out of 5
Keywords: opencv, opencv cuda, machine learning, how to install opencv with cuda, install opencv cuda, build and install opencv with cuda gpu support on windows 10, windows 10, opencv python, install opencv, install cuda toolkit windows 10, hackers realm, installation tutorial, opencv cuda python, opencv contrib python install, install cuda, cuda gpu, python, computer vision, gpu acceleration, artificial intelligence, performance optimization, opencv tutorial, opencv python tutorial
Id: 5NwU1MmmqWo
Channel Id: undefined
Length: 17min 34sec (1054 seconds)
Published: Mon Feb 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.