• DepthAI-v2
  • DepthAI - Sneak peak into Windows support!

Hi!
I have been working on refactoring the current DepthAI library and Python bindings. This effort turned out to also provide a solid ground to try compiling the library on Windows.

Thanks to CMake and their awesome cross-platform support the whole endeavor didn't take much more than a couple of hours.

If you would like to give it a try and have Python 3.7 64-bit currently installed on the system, go ahead and checkout "refactor" branch of depthai repository:

git clone https://github.com/luxonis/depthai.git --branch refactor --single-branch

Then its off to running python depthai.py as usual.

If on the other hand you would like to dive in and try compiling it yourself then feel free to follow the instructions bellow (Tested generators: Visual Studio 16 2019 and Visual Studio 15 2017):

Note: Windows PowerShell was used

  1. Clone depthai-api repository and checkout refactor branch
    git clone https://github.com/luxonis/depthai-api.git --branch refactor --single-branch --recursive
  2. Enter the directory and create a build folder
    cd depthai-api
    mkdir build
    cd build

  1. Configure with CMake (Note: Configure step also downloads dependencies, so it might take a while on first run)
    • To specify generator run cmake .. -G to retrieve possible generators
    • If you have 64-bit Python installed specify -A x64 otherwise leave it out
      cmake .. -G"[specify which generator]" [-A x64] -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE="$pwd\..\cmake\ToolchainConfig.cmake"
  2. Build
    cmake --build . --parallel --config Release

The resulting Python wheel will be in Release folder. Copy it over to depthai folder from before and try running the
python depthai.py
with the new wheel.

Best of luck!

Just as quick add-on for folks (like me) who had never used Windows for this sort of development before (excluding Altium, and Windows IDEs), to get git on Windows, I used the following: https://gitforwindows.org/. It's worth noting that all the defaults in that installation worked, and doing git clone https://github.com/luxonis/depthai.git --branch refactor --single-branch worked just like it would in Windows. Which is great!

And I installed Python from the Microsoft Store: https://www.microsoft.com/en-us/p/python-37/9nj46sx7x90p?rtc=1&activetab=pivot:overviewtab

And then I installed python-opencv with pip install opencv-python (in the PowerShell).

And for building, I installed cmake from here and Visual Studio from here, making sure to select Desktop Development with C++ option (below):

So after these installs, I was able to run depthai (without rebuilding, interestingly) from the PowerShell:

3 months later

As an update to above post, the 'develop' branch of depthai repository now installs prebuilt depthai library.
Prebuilt binaries are available for Windows, MacOS and many Linux systems.

To try it out, clone the 'develop' branch:

git clone https://github.com/luxonis/depthai.git --branch develop --single-branch

Do a pip install of requirements:
Note, latest (4.3.0.38) opencv-python does not have a prebuilt binary available for Windows as of now, to circumvent that, install a previous version with the following command:

python -m pip install opencv-python==4.3.0.36

Then proceed with installation of other dependecies (If opencv was installed in last step, it will be skipped by the next)

python -m pip install -r requirements.txt

And run the depthai-demo.py script:

python depthai-demo.py

Best of luck!

    a month later

    I've been installing the depthai develop branch on Window 10 machine, here's how I did this (pretty much covers what themarpe used with additional virtualenv setup). The steps below assume you have Python 3 and git installed.

    1. Open PowerShell as administrator
    2. Type Set-ExecutionPolicy Unrestricted -Force to enable executing scripts from shell
    3. Move to directory where you'd like to install the depthai repository
    4. Confirm that python --version returns correct 3+ version, e.x. Python 3.8.3
    5. Type python -m venv venv to create directory venv with your virtual environment
    6. Use this environment by typing venv\Scripts\activate.ps1. After this command you should see (venv) prefix in your shell prompt
    7. Clone DepthAI repository git clone https://github.com/luxonis/depthai.git --branch develop
    8. Enter the cloned repository cd depthai
    9. Install requirements using python -m pip install -r requirements.txt
    10. Run demo script and see the DepthAI in action using python depthai_demo.py
    15 days later