Installation of SDK Pro on Windows

This section describes how to install Metavision SDK Pro on Windows 10.

Note

Metavision SDK Pro is our premium package giving access to the source code of all the SDK modules allowing you to customize the algorithms and compile on other platforms. Check our packaging page for more information and contact us for a quote if you are interested.

If you only need to have access to the source code of the Open modules (Base, Core, Core ML, Driver, UI, and HAL), compiling our open source project OpenEB will be enough. In that case, follow the specific guide on the Installation of OpenEB.

Supported Cameras

Metavision SDK Pro contains the source code of the Prophesee camera plugin, enabling to stream data from our event-based cameras and to read recordings of event-based data. The supported cameras are:

If you want to use a Prophesee EVK that is not in the list above, it might have been discontinued. Refer to the Prophesee EVKs Support section to find out which previous version of the SDK is supporting it.

If you own a third-party vendor event-based camera, refer to the Camera Plugin Installation page to see how it can be deployed and configured.

Required Configuration

Please note the base system requirements for using Metavision SDK:

  • Operating system: Windows 10 64-bit

  • Architecture: amd64 (a.k.a. x64)

  • Graphic card: must support OpenGL 3.0 minimum

  • CPU: must support AVX2

To install the SDK on Linux, check the page Installation of SDK Pro on Linux.

Required Artifacts

To install Metavision SDK Pro on Windows, you will need the source code archives Prophesee delivered to you:

  • OpenEB: metavision_open_x.y.z.tar

  • Advanced modules: metavision_sdk_sources_cv_x.y.z.tar, metavision_sdk_sources_analytics_x.y.z.tar

  • Standalone applications: metavision_sdk_sources_standalone_apps_x.y.z.tar

Upgrading Metavision

If you are upgrading Metavision from a previous version, you should first read carefully the Release Notes as some changes may impact your usage of our SDK (e.g. API updates) and cameras (e.g. firmware update might be necessary).

Then, if you have previously installed any Prophesee’s software, you will need to uninstall it first. Remove the folders where you installed Metavision artifacts (check both the build folder of the source code and C:\Program Files\Prophesee which is the default install path of the deployment step).

Prerequisites

System Settings

You must enable the support for long paths:

  • Hit the Windows key, type gpedit.msc and press Enter

  • Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem

  • Double-click the “Enable Win32 long paths” option, select the “Enabled” option and click “OK”

Development tools

To compile Metavision, you will need to install some extra tools:

  • install git

  • install CMake 3.21 (more recent versions might not be compatible)

  • install Microsoft Visual C++ compiler (MSVC, 64-bit version). You can choose one of the following solutions:

Installing Dependencies

Install some dependencies with vcpkg:

  • download and extract vcpkg version 2023.11.20 that will be used for installing dependencies

  • then in a command prompt, navigate to the directory where vcpkg was extracted (called VCPKG_SRC_DIR in following sections) and launch the following command:

    bootstrap-vcpkg.bat
    
  • finally, install the following libraries using vcpkg:

    vcpkg.exe install --triplet x64-windows libusb boost opencv dirent gtest glew glfw3 eigen3 hdf5[cpp,threadsafe,tools,zlib] ogre[assimp,core,overlay,zip]
    

Note

If you are using vcpkg for various projects or multiple versions of SDK Pro, you might want to optimize the number of vcpkg install you manage. To do so, you will need the versions of the libraries we require. Those can be found in the vcpkg repository but we list them here for convenience:

  • libusb: 1.0.26

  • boost: 1.83.0

  • opencv: 4.8.0

  • dirent: 1.24.0

  • gtest: 1.14.0

  • glew: 2.2.0

  • glfw3: 3.3.8

  • eigen3: 3.4.0

  • hdf5: 1.14.2

  • ogre: 14.0.1

You should also install FFMPEG library that is required to write videos:

Installing Python

For the Python API, you will need Python and some additional libraries. If Python is not available on your system, install it:

  • Download the installer for one of the supported Python versions:

  • Run the installer and follow the prompt

  • Add Python install and script directories in your PATH and make sure they are listed before the WindowsApps folder which contains a Python alias launching the Microsoft Store. So, if you installed Python 3.8 in the default path, your user PATH should contain those three lines in that order:

    %USERPROFILE%\AppData\Local\Programs\Python\Python38
    %USERPROFILE%\AppData\Local\Programs\Python\Python38\Scripts
    %USERPROFILE%\AppData\Local\Microsoft\WindowsApps
    

Then, install required Python libraries using pip. Open a command prompt and run the command:

python -m pip install pip --upgrade
python -m pip install "opencv-python==4.5.5.64" "sk-video==1.1.10" "fire==0.4.0" "numpy==1.23.4" "h5py==3.7.0" pandas scipy
python -m pip install matplotlib "ipywidgets==7.6.5" pytest command_runner

Installing pybind

The Python bindings of the C++ API rely on the pybind11 library (version >= 2.6.0).

You should install pybind using vcpkg in order to get the appropriate version:

vcpkg.exe install --triplet x64-windows pybind11

Note

pybind11 is required only if you plan to use the Python bindings of the C++ API . You can skip compiling these bindings by passing the argument -DCOMPILE_PYTHON3_BINDINGS=OFF during compilation (see step 3 in the section “Compilation using CMake”). This allows you to skip installing pybind11, but you won’t be able to use our Python interface to the C++ API.

Prerequisites for the CV3D module

To use the CV3D module, you need to install a third-party Sophus library that is required to handle geometric transformation problems:

  • Clone the Sophus repository:

    git clone https://github.com/strasdat/Sophus.git
    
  • Go to the Sophus directory:

    cd Sophus
    
  • As of February 2024, there is a bug in Sophus repo preventing to compile on Windows, so you should check-out a specific commit as a workaround:

    git checkout e10eb6e00cecc3cbeebb893f8a739120de151156
    
  • Create and open the build directory

    mkdir build && cd build
    
  • Create a directory where Sophus will be installed (make sure you have the write permission in that directory):

    mkdir <sophus_install_path>
    
  • Compile and install (note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):

    cmake .. -DCMAKE_TOOLCHAIN_FILE=<VCPKG_SRC_DIR>\scripts\buildsystems\vcpkg.cmake -DCMAKE_INSTALL_PREFIX=<sophus_install_path> -DSOPHUS_USE_BASIC_LOGGING=ON
    cmake --build . --config Release
    cmake --build . --target install
    

Prerequisites for the ML module

To use Machine Learning features, you need to install some additional dependencies.

If you have some Nvidia hardware with GPUs, you can optionally install CUDA (11.6 or 11.7) and cuDNN to leverage them with PyTorch and LibTorch. Make sure that you install a version of CUDA that is compatible with your GPUs by checking Nvidia compatibility page.

Note

At the moment, we don’t support OpenCL and AMD GPUs.

Python Packages

You need to install PyTorch 1.13.1. Retrieve and execute the pip command of version 1.13.1 from the previous versions install guide section.

Then install some extra Python libraries:

python -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning==1.8.6" "tqdm==4.63.0" "kornia==0.6.8"
python -m pip install "llvmlite==0.39.1" "pycocotools==2.0.7" "seaborn==0.11.2" "torchmetrics==0.7.2" "pillow==9.3.0"

LibTorch for C++

To compile and run the neural network inference in a C++ pipeline, you need LibTorch (PyTorch’s C++ frontend)

Prerequisites for standalone apps

To be able to compile Metavision Studio, you need to install NodeJS by downloading and running NodeJS 16.18.1 installer

Preparation of the source code

First, extract the content of the archive metavision_open_x.y.z.tar:

tar -xvf metavision_open_x.y.z.tar

This will create the folder openeb-x.y.z containing OpenEB source code. The absolute path to this directory is called MV_SDK_SRC_DIR in the next sections.

Then extract the other SDK Pro archives in MV_SDK_SRC_DIR:

tar -xvf metavision_sdk_sources_standalone_apps_x.y.z.tar -C <MV_SDK_SRC_DIR>
tar -xvf metavision_sdk_sources_analytics_x.y.z.tar -C <MV_SDK_SRC_DIR>
tar -xvf metavision_sdk_sources_calibration_x.y.z.tar -C <MV_SDK_SRC_DIR>
tar -xvf metavision_sdk_sources_cv3d_x.y.z.tar -C <MV_SDK_SRC_DIR>
tar -xvf metavision_sdk_sources_cv_x.y.z.tar -C <MV_SDK_SRC_DIR>
tar -xvf metavision_sdk_sources_ml_x.y.z.tar -C <MV_SDK_SRC_DIR>

Compilation

Follow one of the next sections depending of the tool you chose: CMake or MS Visual Studio.

Compilation using CMake

Open a command prompt and follow those steps:

  1. Open the MV_SDK_SRC_DIR directory

cd MV_SDK_SRC_DIR
  1. Create and open the build directory:

mkdir build && cd build
  1. Generate the solution using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):

cmake .. -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch

you can adapt this command depending on the module you choose to install:

  • to skip the compilation of the CV3D module, remove the Sophus options

  • to skip the compilation of the ML module, remove the Torch options

  1. Compile:

cmake --build . --config Release --parallel 4

Once the compilation is done, you have two options: you can choose to work directly from the build folder or you can deploy the SDK Pro files (applications, samples, libraries etc.) in a directory of your choice.

  • Option 1 - working from build folder

    • To use SDK Pro directly from the build folder, you need to update some environment variables using this script:

      utils\scripts\setup_env.bat
      
  • Option 2 - deploying in a directory of your choice

    • To deploy SDK Pro in the default folder (C:\Program Files\Prophesee), execute this command (your console should be launched as an administrator):

      cmake --build . --config Release --target install
      
    • To deploy SDK Pro in another folder, you should generate the solution again (step 3 above) with the additional variable CMAKE_INSTALL_PREFIX having the value of your target folder (SDK_PRO_INSTALL_DIR).

      Similarly, to specify where the Python packages will be deployed (PYTHON3_PACKAGES_INSTALL_DIR), you should use the PYTHON3_SITE_PACKAGES variable.

      Here is an example of a command customizing those two folders:

      cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<SDK_PRO_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch
      

      After this command, you should launch the actual compilation and installation of SDK Pro (your console should be launched as an administrator):

      cmake --build . --config Release --parallel 4
      cmake --build . --config Release --target install
      
    • You also need to manually edit some environment variables:

      • append <SDK_PRO_INSTALL_DIR>\bin to PATH (C:\Program Files\Prophesee\bin if you used default configuration)

      • append <SDK_PRO_INSTALL_DIR>\lib\metavision\hal\plugins to MV_HAL_PLUGIN_PATH (C:\Program Files\Prophesee\lib\metavision\hal\plugins if you used default configuration)

      • append <SDK_PRO_INSTALL_DIR>\lib\hdf5\plugin to HDF5_PLUGIN_PATH (C:\Program Files\Prophesee\lib\hdf5\plugin if you used default configuration)

      • append <PYTHON3_PACKAGES_INSTALL_DIR> to PYTHONPATH (not needed if you used default configuration)

Compilation using MS Visual Studio

Open a command prompt and follow those steps:

  1. Open the MV_SDK_SRC_DIR directory

cd MV_SDK_SRC_DIR
  1. Create and open the build directory:

mkdir build && cd build
  1. Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one):

cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF -DUSE_SOPHUS=ON -DSophus_DIR=<SOPHUS_DIR_PATH>\share\sophus\cmake -DUSE_TORCH=ON -DTorch_DIR=<LIBTORCH_DIR_PATH>\share\cmake\Torch
  1. Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.

Once the compilation is done, you have two options: you can choose to work directly from the build folder or you can deploy the SDK Pro files (applications, samples, libraries etc.) in a directory of your choice.

  • Option 1 - working from build folder

    • To use SDK Pro directly from the build folder, you need to update the environment variables as done in this script:

      utils\scripts\setup_env.bat
      
  • Option 2 - deploying SDK Pro

    • To deploy SDK Pro, you need to build the INSTALL project. By default, files will be deployed in C:\Program Files\Prophesee

Camera Plugins

Prophesee camera plugin is included in SDK Pro, but you need to install the drivers for the cameras to be available on Windows. To do so, follow this procedure:

  • download wdi-simple.exe from our file server

  • execute the following commands in a Command Prompt launched as an administrator:

    wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f4
    wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f5
    wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x04b4 -p 0x00f3
    

If you own an EVK2 or an RDK2, there are a few additional steps to complete.

First, check in your device manager that you have the three following interfaces when your camera is connected: CDC NCM; EVK2; fastboot, displayed as below with a warning sign (from left to right, picture 1). If not, uninstall the device already installed as shown in picture 2 and 3 (generally the already installed device is, either EVK2 if you connect an EVK2 device or fastboot if you connect an RDK2 device).

pic1 pic2 pic3

Kindly note that you should repeat this uninstall operation until your device (EVK2/fastboot) is not recognized anymore and appears in other devices with a warning sign.

Also, we recommend to double check the interface number of your device (the number just after the -i option when using wdi-simple.exe as presented in the next paragraph). To do so, right click on the name of the interface you want to install (CDC NCM, EVK2``or ``fastboot) in your device manager and follow the steps depicted in the pictures below:

pic4 pic5

For example, we can see on the right picture that the interface number is 03.

Now, you can install the relevant driver with the following command:

wdi-simple.exe -n "EVK" -m "Prophesee" -v 0x03fd -p 0x5832 -i <INTERFACE_NUMBER>

If you are using a third-party camera, you need to follow the instructions provided by the camera vendor to install the driver and the camera plugin. Make sure that you reference the location of the plugin in the MV_HAL_PLUGIN_PATH environment variable.

Running tests

Running the test suite is a sure-fire way to ensure you did everything well with your compilation and installation process. The more modules you add the more tests will be run when you do this step.

  • Download the files necessary and click on the Download All button to retrieve an archive of all the files necessary to run the tests. Please be aware that the archive you’ll receive is approximately 5 Gb in size.

  • Extract and put the contents of this archive into <MV_SDK_SRC_DIR>. For instance, the correct path of sequence gen31_timer.raw should be <MV_SDK_SRC_DIR>/datasets/openeb/gen31_timer.raw.

  • To run the test suite you need to reconfigure your build environment using CMake and to recompile. Make sure that all your pro modules were properly configured.

  • Compilation using only CMake

    1. Regenerate the build using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):

    cd <MV_SDK_SRC_DIR>/build
    cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
    
    1. Compile:

    cmake --build . --config Release --parallel 4
    
  • Compilation using CMake and MS Visual Studio

    1. Generate the Visual Studio files using CMake (adapt the command to your Visual Studio version and note that the value passed to the parameter -DCMAKE_TOOLCHAIN_FILE must be an absolute path, not a relative one.):

    cmake .. -G "Visual Studio 17 2022" -A x64 -DCMAKE_TOOLCHAIN_FILE=<MV_SDK_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
    
    1. Open the solution file metavision.sln, select the Release configuration and build the ALL_BUILD project.

  • Running the test suite (after making sure you launched the script utils\scripts\setup_env.bat mentioned before):

    ctest -C Release
    

Get started!

You are now ready to use Metavision SDK. The best way to start getting familiar with the event-based technology is to open an event-based camera with Metavision Studio to begin data collection and visualization. You can choose to dive directly in the SDK by following a getting started guide or looking at a Code Sample.