Installation of SDK on Linux Ubuntu

This section describes how to install Metavision SDK on Linux Ubuntu 20.04 and 22.04 64-bit.

Note

Metavision SDK comes as pre-built Ubuntu packages of our whole software offer including the Prophesee Camera Plugins. It does not require compilation and installation of our open source project OpenEB. Though if you want to compile OpenEB, follow the specific guide on the Installation of OpenEB.

Required Configuration

Please note the base system requirements for using Metavision:

  • Operating system: Linux Ubuntu 20.04 or 22.04 64-bit

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

  • Graphic card: must support OpenGL 3.0 minimum

  • CPU: must support AVX2

For Windows, see the page SDK installation on Windows. For other operating systems and architectures, you must clone our open source project OpenEB and contact us if you run into compatibility issues.

Required Artifacts

To install Metavision SDK on Linux, you will need our APT repository configuration file metavision.list.

  • Whether you are installing the SDK for the first time or are currently using a previous version (e.g. 3.0.x or 3.1.x), you must sign-up and download metavision.list.

  • If you are currently using the last version and are willing to install a patch (e.g. from x.y.0 to x.y.1) you can use the same metavision.list that gives access to all patches of a given minor version.

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, you will need to remove the previously installed Prophesee software:

sudo apt remove '~nprophesee-.*' '~nmetavision-.*' --purge

Warning

Removing the old version of Metavision SDK is mandatory even for patch upgrade (e.g. from x.y.0 to x.y.1)

Installing Dependencies

Install additional packages required to manage videos and diagnose OpenGL drivers:

sudo apt -y install libcanberra-gtk-module mesa-utils ffmpeg

To execute our Python Samples and use the Python API, you will need Python and some additional libraries. We support Python 3.8 and 3.9 on Ubuntu 20.04 and Python 3.9 and 3.10 on Ubuntu 22.04. If Python is not available on your system, install it:

sudo apt -y install python3-pip
sudo apt -y install python3.X-dev  # where X is 8, 9 or 10 depending on your Python version (3.8, 3.9 or 3.10)

Then install some extra libraries (note that you can skip this step if you don’t plan to use our Python samples/API and are willing to use Metavision Studio only for now):

python3 -m pip install pip --upgrade
python3 -m pip install "opencv-python==4.5.5.64" "sk-video==1.1.10" "fire==0.4.0" "numpy==1.23.4" pandas scipy h5py
python3 -m pip install jupyter jupyterlab matplotlib "ipywidgets==7.6.5"

Note

You can use anaconda to install Python and conda to manage your Python packages, but be sure to use a Python version that we support. You will need to adapt the library installation steps accordingly and use conda whenever we use pip.

In addition, check that conda PYTHONPATH contains /usr/lib/python3/dist-packages/. If not, add it. For example with sys.path.append() method of python module sys:

import sys
print(sys.path)
# Add /usr/lib/python3/dist-packages/ to PYTHONPATH if the output of print(sys.path) does not mention it.
sys.path.append("/usr/lib/python3/dist-packages/")

In this documentation, we chose to use pip as a package manager. We recommend using it with virtualenv to avoid conflicts with other installed Python packages.

To compile the C++ code samples, you need to install CMake and some libraries:

sudo apt -y install cmake libboost-program-options-dev libeigen3-dev

Installation

Unless you are doing a patch upgrade (e.g. from x.y.0 to x.y.1), you must configure the APT software repositories of your system:

  • First, clean your sources list and preferences directories from potential earlier installation of Prophesee software:

    • remove any prophesee file (e.g. essentials.list, prophesee.list, sdk.list, metavision.list or designer.list) from the folder /etc/apt/sources.list.d

      cd /etc/apt/sources.list.d
      sudo rm prophesee.list essentials.list metavision.list designer.list
      
    • Remove any Prophesee file (e.g. prophesee) from the folder /etc/apt/preferences.d

      sudo rm /etc/apt/preferences.d/prophesee
      
    • Remove any Prophesee Server listed in the file /etc/apt/sources.list

  • Then, add Prophesee’s servers to the list of APT repositories by copying your metavision.list file to the folder /etc/apt/sources.list.d

    sudo cp metavision.list /etc/apt/sources.list.d
    
  • If you are on Ubuntu 20, you need to add an extra APT repository to retrieve OGRE dependency during SDK install:

    sudo add-apt-repository -y ppa:s-schmeisser/ogre-1.12
    
  • Update the list of repositories and packages:

    sudo apt update
    

Now you are ready to install Metavision SDK:

sudo apt -y install metavision-sdk

Warning

If the above command returns the error E: unable to locate package metavision-sdk, it might mean that you did not properly install the APT server list. More probably, you tried to install Metavision SDK on a platform that we don’t support. In that case, ensure that your OS is Ubuntu 20.04 or 22.04 on amd64/x64. For example, if you are trying to install on a NVidia Jetson or a Raspberry Pi, you will get this error as both are not amd64-based but arm-based. If you want to work on a non-supported platform, you should try to compile OpenEB, our open-source project.

Note

For a given minor release of Metavision SDK (e.g. 3.1), all the patch versions (e.g. 3.1.1 and 3.1.2) can be installed from our APT repository and by default the most recent one will be installed. To install a specific patch version (here 3.1.0), you have to pin this version in the APT server configuration:

sudo sh -c "echo 'Package: metavision-*
Pin: version 3.1.0
Pin-Priority: 1001' > /etc/apt/preferences.d/prophesee"

And then update the list of repositories and install Metavision SDK:

sudo apt update
sudo apt -y install metavision-sdk

If you want to install an old version of Metavision SDK (e.g. 3.1.x), you need to use the APT .list file corresponding to that version. If you don’t have it, you will have to go through the sign-up page of the version you are interested in (links for previous minor versions: 2.1, 2.2, 2.3, 3.0 and 3.1). Then you should follow the installation guide of this version.

Regarding our Python API, the previous command installs the Python bindings of our C++ libraries for the default version of Python of your Ubuntu version (Python 3.8 on Ubuntu 20.04 and 3.10 on Ubuntu 22.04). If you want to use another supported Python version (namely 3.9), you should install an extra package:

sudo apt -y install metavision-sdk-python3.9

To use our HDF5 ECF codec plugin with some HDF5 tools (for example h5py), you have to install our HDF5 plugin and may have to modify the HDF5_PLUGIN_PATH:

  • For Ubuntu 20.04:

    sudo apt install hdf5-plugin-ecf
    export HDF5_PLUGIN_PATH=$HDF5_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/hdf5/plugins
    
  • For Ubuntu 22.04:

    sudo apt install hdf5-plugin-ecf
    export HDF5_PLUGIN_PATH=$HDF5_PLUGIN_PATH:/usr/lib/x86_64-linux-gnu/hdf5/serial/plugins
    

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 Tutorial or looking at a Code Sample.

If you want to use the Machine Learning modules (ML and Core ML), please follow the next section that describes the required additional dependencies.

Additional Dependencies for Machine Learning 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.

Packages for Python

Then, you will 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.

Metavision ML has additional Python requirements that can be installed with pip:

python3 -m pip install "numba==0.56.3" "profilehooks==1.12.0" "pytorch_lightning==1.8.6" "tqdm==4.63.0" "kornia==0.6.8"
python3 -m pip install "llvmlite==0.39.1" "pycocotools==2.0.4" "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)

  • Download the LibTorch version corresponding to your CUDA version (or take the CPU version if you don’t have CUDA):

  • Unzip the archive to a new folder LIBTORCH_DIR_PATH that you will reference when compiling the C++ inference sample. For example, for the CPU version:

    unzip libtorch-cxx11-abi-shared-with-deps-1.13.1+cpu.zip -d LIBTORCH_DIR_PATH
    
  • LibTorch is delivered with a copy of libgtest libraries. Those should be removed to avoid conflicts:

    rm LIBTORCH_DIR_PATH/libtorch/lib/libgtest.a
    rm LIBTORCH_DIR_PATH/libtorch/lib/libgtest_main.a
    

Pre-trained Models

We also provide pre-trained models for inference in automotive applications. They can be downloaded during the sign-up.