Install OpenCV AI Kit (OAK) on Windows
OpenCV AI Kit (OAK)
Today we are going to try an interesting device: OpenCV AI Kit (OAK) version D on Windows. In this tutorial, specifically, we will see:
- How to install OpenCV AI Kit (OAK) on windows
- Run three deep learning models: Object Detection, Face Detection, Depth Tracking.
1. How to install OpenCV AI Kit (OAK) on windows
The installation of the API associated with OpenCV AI Kit (OAK) is simple because it already has API and support available with many models ready for use.
First, you have to go to Github and exactly in the link https://github.com/luxonis/depthai to download the files.
In my case, I downloaded and extracted the folder on the desktop. We open the folder and look for the python intall_requirements.py file. Running this file will automatically install all the required libraries
For convenience, we do everything via windows command prompt. First, access the depthai-main folder with the cd command and then run the python file.
cd your_folder_path python install_requirements.py
Obviously, make sure you have python installed otherwise the installation of OpenCV AI Kit (OAK) on Windows will not work. In my case, it has installed everything correctly but if there are problems read the error messages carefully and it will be easier for you to find the problem.
OpenCV AI Kit (OAK) first test
Make sure your device is properly connected to the computer through the usb-c cable. So let’s proceed with the test. Always on the command prompt and inside the run folder
Watch out for the download and a few seconds for it to run. The result you will get on the first test will be this:
As you can see it uses SSD model for person detection.
2. Run three deep learning models:
You can use different models and develop different projects with OpenCV AI Kit (OAK) on Windows but we will concentrate on testing only three. In any case, always make sure you have opened the windows command prompt and are inside the depthai-main folder.
To see the list of available neural network models you can go to https://github.com/luxonis/depthai/tree/main/resources/nn
1. object detection
Now let’s run the command to test mobilenet-ssd. This model can identify 20 categories.
python depthai_demo.py -cnn mobilenet-ssd
This is the result. In the example image you can see how he correctly recognizes the image of the cat that I showed him
2. Face detection
Let’s now try a new face-detection-adas-0001 model .
python depthai_demo.py -cnn face-detection-adas-0001
Model processing is a bit slower than the image but the result is quite good. Here is the result
3. Depth tracking
Deep tracking allows us to understand how far the object are. The closer the object is, the more yellow it will be, the farther the object is and it will change from deep red to black.
The applications for such use are many. Let’s just think of a robotic arm that has to identify the depth of an object to prevent it from going too close or for there to be a collision. As you can see from the window we get the positions in the space (x, y, z) expressed in meters
python depthai_demo.py -s metaout depth_raw -bb
In the image below the result