Compiling OpenEB on Windows
This section describes how to compile OpenEB on Windows.
Compilation and execution were tested on platforms that meet the following requirements:
Windows: version 10 64-bit
Architecture: amd64 (a.k.a. x64)
Graphic card with support of OpenGL 3.0 minimum
CPU with support of AVX2
Compilation on other versions of Windows was not tested. For those, some adjustments to this guide or to the code itself may be required.
Note
OpenEB is the open source version of our code base for the modules Base, Core, Core ML, Driver, UI, and HAL (see Metavision modules organization). If you acquired the full source code of the SDK (through our SDK Pro offer), OpenEB will also be the basis of your installation, but you should follow the installation guide of SDK Pro.
If you don’t want to go through some compilation steps, you can download pre-built Windows installer of Metavision modules. To do so, follow our specific installation guide.
Warning
Some steps of this procedure don’t work on FAT32 and exFAT file system. Make sure that you are using a NTFS file system before going further.
Table of Contents
Supported Cameras
OpenEB 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.
Upgrading OpenEB
If you are upgrading OpenEB 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 OpenEB, 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) included in Visual Studio 2022 - Fall 2023 LTSC (version 17.8). If you install the Build Tools only, make sure Windows 10 SDK is checked, and add English Language Pack.
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 hdf5[cpp,threadsafe,tools,zlib]
Note
If you are using vcpkg for various projects or multiple versions of OpenEB, 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
hdf5: 1.14.2
You should also install FFMPEG library that is required to write videos:
Add the
bin
directory of the FFMPEG install to yourPATH
Installing Python and libraries
Install Python version 3.8 or 3.9, if not yet available on your machine:
Download the installer for one of the supported Python versions:
Python 3.8 (“Windows installer (64-bit)”)
Python 3.9 (“Windows installer (64-bit)”)
Run the installer and follow the prompt
Add Python install and script directories in your
PATH
and make sure they are listed before theWindowsApps
folder which contains a Python alias launching the Microsoft Store. So, if you installed Python 3.8 in the default path, your userPATH
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 2 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 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"
Compilation
First, retrieve the source code of OpenEB
git clone https://github.com/prophesee-ai/openeb.git --branch 4.6.2
Warning
If you choose to download an archive of OpenEB from GitHub rather than cloning the repository,
you need to ensure that you select a Full.Source.Code.*
archive instead of using
the automatically generated Source.Code.*
archives. This is because the latter do not include
a necessary submodule.
Compilation using CMake
Open a command prompt inside the openeb
folder and follow the steps:
(absolute path to this directory is called OPENEB_SRC_DIR
in next sections).
Create and open the build directory where temporary files will be created:
mkdir build && cd build
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=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF
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 OpenEB files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use OpenEB 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 OpenEB 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 OpenEB in another folder, you should generate the solution again (step 2 above) with the additional variable
CMAKE_INSTALL_PREFIX
having the value of your target folder (OPENEB_INSTALL_DIR
).Similarly, to specify where the Python packages will be deployed (
PYTHON3_PACKAGES_INSTALL_DIR
), you should use thePYTHON3_SITE_PACKAGES
variable.Here is an example of a command customizing those two folders:
cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR> -DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR> -DBUILD_TESTING=OFF
After this command, you should launch the actual compilation and installation of OpenEB (your console should be launched as an administrator):
cmake --build . --config Release --parallel 4 cmake --build . --config Release --target installYou also need to manually edit some environment variables:
append
<OPENEB_INSTALL_DIR>\bin
toPATH
(C:\Program Files\Prophesee\bin
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\metavision\hal\plugins
toMV_HAL_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\metavision\hal\plugins
if you used default configuration)append
<OPENEB_INSTALL_DIR>\lib\hdf5\plugin
toHDF5_PLUGIN_PATH
(C:\Program Files\Prophesee\lib\hdf5\plugin
if you used default configuration)append
<PYTHON3_PACKAGES_INSTALL_DIR>
toPYTHONPATH
(not needed if you used default configuration)
Compilation using MS Visual Studio
Open a command prompt inside the openeb
folder and follow the steps:
(absolute path to this directory is called OPENEB_SRC_DIR
in next sections).
Create and open the build directory where temporary file will be created:
mkdir build && cd build
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=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=OFF
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 OpenEB files (applications, samples, libraries etc.) in a directory of your choice.
Option 1 - working from
build
folder
To use OpenEB 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 OpenEB
To deploy OpenEB, you need to build the
INSTALL
project. By default, files will be deployed inC:\Program Files\Prophesee
Camera Plugins
Prophesee camera plugin is included in OpenEB, 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).
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:
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.
Go to this page 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 1.2 Gb in size.Extract and put the contents of this archive into
<OPENEB_SRC_DIR>/datasets
. For instance, the correct path of sequence gen31_timer.raw should be <OPENEB_SRC_DIR>/datasets/openeb/gen31_timer.raw.To run the test suite you need to reconfigure your build environment using CMake and to recompile.
Compilation using only CMake
Regenerate the build using CMake (note that -DCMAKE_TOOLCHAIN_FILE must be absolute path, not a relative one):
cd <OPENEB_SRC_DIR>/build cmake .. -A x64 -DCMAKE_TOOLCHAIN_FILE=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
Compile:
cmake --build . --config Release --parallel 4
Compilation using CMake and MS Visual Studio
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=<OPENEB_SRC_DIR>\cmake\toolchains\vcpkg.cmake -DVCPKG_DIRECTORY=<VCPKG_SRC_DIR> -DBUILD_TESTING=ON
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 OpenEB. The best way to start getting familiar with the event-based technology is to open an event-based camera with Metavision Viewer 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.