Skip to content

Commit

Permalink
Release OpenEB 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ogeorget-psee committed Nov 25, 2022
1 parent dcf571e commit 474368f
Show file tree
Hide file tree
Showing 40 changed files with 558 additions and 437 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/all_jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update && sudo apt-get install -y sudo apt-utils wget cmake build-essential \
libglew-dev git g++ libusb-1.0-0-dev libeigen3-dev libgtest-dev libssl-dev \
libglew-dev git g++ libusb-1.0-0-dev libgtest-dev libssl-dev \
python3-pip python3-distutils xvfb libglfw3 libglfw3-dev libglew-dev libopencv-dev ffmpeg \
libboost-dev libboost-program-options-dev libboost-filesystem-dev libboost-timer-dev \
libboost-chrono-dev libboost-thread-dev zip unzip git-lfs
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get -y update && sudo apt-get install -y sudo apt-utils wget cmake build-essential \
libglew-dev git g++ libusb-1.0-0-dev libeigen3-dev libgtest-dev libssl-dev \
libglew-dev git g++ libusb-1.0-0-dev libgtest-dev libssl-dev \
python3-pip python3-distutils xvfb libglfw3 libglfw3-dev libglew-dev libopencv-dev ffmpeg \
libboost-dev libboost-program-options-dev libboost-filesystem-dev libboost-timer-dev \
libboost-chrono-dev libboost-thread-dev zip unzip
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

cmake_minimum_required(VERSION 3.5)

project(metavision VERSION 3.1.0)
project(metavision VERSION 3.1.1)
set(PROJECT_VERSION_SUFFIX "")

if(PROJECT_VERSION_SUFFIX STREQUAL "")
Expand Down
33 changes: 24 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,22 @@ python3 -m pip install pip --upgrade

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

First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2, 11.1 or 11.3) <https://developer.nvidia.com/cuda-downloads>`_
First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2 or 11.1) <https://developer.nvidia.com/cuda-downloads>`_
and `cuDNN <https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html>`_ 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 <https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html>`_.

Note that, at the moment, we don't support `OpenCL <https://www.khronos.org/opencl/>`_ and AMD GPUs.

Then, install pytorch. Go to `pytorch.org <https://pytorch.org>`_ to retrieve the pip command that you
will launch in a console to install PyTorch 1.8.2 LTS. Here is an example of a command that can be retrieved for
Then, install PyTorch 1.8.2 LTS. This version was deprecated by PyTorch team but can still be downloaded
in `the Previous Versions page of pytorch.org <https://pytorch.org/get-started/previous-versions/#v182-with-lts-support>`_
(in future releases of Metavision ML, more recent version of PyTorch will be leveraged).
Retrieve and execute the pip command for the installation. Here is an example of a command that can be retrieved for
pytorch using CUDA 11.1:

```bash
python3 -m pip install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
python3 -m pip install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111
```

Then install some extra Python libraries:
Expand Down Expand Up @@ -130,17 +132,30 @@ with the following command: `sudo cmake --build . --target install`. In that cas
`LD_LIBRARY_PATH` with `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib` (If you want to update this path
permanently, you should add the previous command in your ~/.bashrc)

*Note* that since OpenEB 3.0.0, Prophesee camera plugins are included in the OpenEB repository, so you don't need to perform
any extra step to install them. If you are using a third-party camera, you need to install the plugin provided
by the camera vendor and specify the location of the plugin using the `MV_HAL_PLUGIN_PATH` environment variable.
You can also deploy the OpenEB files (applications, samples, libraries etc.) in a directory of your choice by using
the `CMAKE_INSTALL_PREFIX` variable (`-DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR>`) when generating the makefiles
in step 3. Similarly, you can configure the directory where the Python packages will be deployed using the
`PYTHON3_SITE_PACKAGES` variable (`-DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR>`).

Since OpenEB 3.0.0, Prophesee camera plugins are included in OpenEB. If you did not perform the optional deployment step
(`sudo cmake --build . --target install`) and instead used “setup_env.sh”, then you need to copy the udev rules files
used by Prophesee cameras in the system path and reload them so that your camera is detected with this command:

```bash
sudo cp $METAVISION_SRC_DIR/hal_psee_plugins/resources/rules/*.rules /etc/udev/rules.d
udevadm control --reload-rules
udevadm trigger
```

If you are using a third-party camera, you need to install the plugin provided by the camera vendor and specify
the location of the plugin using the `MV_HAL_PLUGIN_PATH` environment variable.

To get started with OpenEB, you can download some [sample recordings](https://docs.prophesee.ai/stable/datasets.html)
and visualize them with [metavision_viewer](https://docs.prophesee.ai/stable/metavision_sdk/modules/driver/guides/viewer.html#chapter-sdk-driver-samples-viewer)
or you can stream data from your Prophesee-compatible event-based camera.

### Running the test suite (Optional)


Running the test suite is a sure-fire way to ensure you did everything well with your compilation and installation process.

* Download [the files](https://dataset.prophesee.ai/index.php/s/hyCzGM4tpR8w5bx) necessary to run the tests.
Expand Down Expand Up @@ -232,7 +247,7 @@ python -m pip install pip --upgrade

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

First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2, 11.1 or 11.3) <https://developer.nvidia.com/cuda-downloads>`_
First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2 or 11.1) <https://developer.nvidia.com/cuda-downloads>`_
and `cuDNN <https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html>`_ to leverage them with pytorch and libtorch.

Then, install pytorch. Go to `pytorch.org <https://pytorch.org>`_ to retrieve the pip command that you
Expand Down
6 changes: 3 additions & 3 deletions cmake/custom_functions/add_library_version_header.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and limitations under the License.

set(GIT_BRANCH "main")
set(GIT_COMMIT_ID "4c19f90e13c20548513c88b89c4e58bc8de8a1bf")
set(GIT_COMMIT_DATE "2022-10-13 16:56:39 +0200")
set(GIT_BRANCH "HEAD")
set(GIT_COMMIT_ID "37aa7510f3d6bdbd2b2b66e816d4fb0e3a420e9d")
set(GIT_COMMIT_DATE "2022-11-23 15:21:14 +0100")

# If git information are not provided in command line when running cmake, try to automatically determine them
if(NOT GIT_BRANCH OR NOT GIT_COMMIT_ID OR NOT GIT_COMMIT_DATE)
Expand Down
33 changes: 24 additions & 9 deletions cmake/custom_targets/README_metavision_open.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,22 @@ python3 -m pip install pip --upgrade

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

First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2, 11.1 or 11.3) <https://developer.nvidia.com/cuda-downloads>`_
First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2 or 11.1) <https://developer.nvidia.com/cuda-downloads>`_
and `cuDNN <https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html>`_ 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 <https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html>`_.

Note that, at the moment, we don't support `OpenCL <https://www.khronos.org/opencl/>`_ and AMD GPUs.

Then, install pytorch. Go to `pytorch.org <https://pytorch.org>`_ to retrieve the pip command that you
will launch in a console to install PyTorch 1.8.2 LTS. Here is an example of a command that can be retrieved for
Then, install PyTorch 1.8.2 LTS. This version was deprecated by PyTorch team but can still be downloaded
in `the Previous Versions page of pytorch.org <https://pytorch.org/get-started/previous-versions/#v182-with-lts-support>`_
(in future releases of Metavision ML, more recent version of PyTorch will be leveraged).
Retrieve and execute the pip command for the installation. Here is an example of a command that can be retrieved for
pytorch using CUDA 11.1:

```bash
python3 -m pip install torch==1.8.2+cu111 torchvision==0.9.2+cu111 torchaudio==0.8.2 -f https://download.pytorch.org/whl/lts/1.8/torch_lts.html
python3 -m pip install torch==1.8.2 torchvision==0.9.2 torchaudio==0.8.2 --extra-index-url https://download.pytorch.org/whl/lts/1.8/cu111
```

Then install some extra Python libraries:
Expand Down Expand Up @@ -130,17 +132,30 @@ with the following command: `sudo cmake --build . --target install`. In that cas
`LD_LIBRARY_PATH` with `export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib` (If you want to update this path
permanently, you should add the previous command in your ~/.bashrc)

*Note* that since OpenEB 3.0.0, Prophesee camera plugins are included in the OpenEB repository, so you don't need to perform
any extra step to install them. If you are using a third-party camera, you need to install the plugin provided
by the camera vendor and specify the location of the plugin using the `MV_HAL_PLUGIN_PATH` environment variable.
You can also deploy the OpenEB files (applications, samples, libraries etc.) in a directory of your choice by using
the `CMAKE_INSTALL_PREFIX` variable (`-DCMAKE_INSTALL_PREFIX=<OPENEB_INSTALL_DIR>`) when generating the makefiles
in step 3. Similarly, you can configure the directory where the Python packages will be deployed using the
`PYTHON3_SITE_PACKAGES` variable (`-DPYTHON3_SITE_PACKAGES=<PYTHON3_PACKAGES_INSTALL_DIR>`).

Since OpenEB 3.0.0, Prophesee camera plugins are included in OpenEB. If you did not perform the optional deployment step
(`sudo cmake --build . --target install`) and instead used “setup_env.sh”, then you need to copy the udev rules files
used by Prophesee cameras in the system path and reload them so that your camera is detected with this command:

```bash
sudo cp $METAVISION_SRC_DIR/hal_psee_plugins/resources/rules/*.rules /etc/udev/rules.d
udevadm control --reload-rules
udevadm trigger
```

If you are using a third-party camera, you need to install the plugin provided by the camera vendor and specify
the location of the plugin using the `MV_HAL_PLUGIN_PATH` environment variable.

To get started with OpenEB, you can download some [sample recordings](https://docs.prophesee.ai/stable/datasets.html)
and visualize them with [metavision_viewer](https://docs.prophesee.ai/stable/metavision_sdk/modules/driver/guides/viewer.html#chapter-sdk-driver-samples-viewer)
or you can stream data from your Prophesee-compatible event-based camera.

### Running the test suite (Optional)


Running the test suite is a sure-fire way to ensure you did everything well with your compilation and installation process.

* Download [the files](https://dataset.prophesee.ai/index.php/s/hyCzGM4tpR8w5bx) necessary to run the tests.
Expand Down Expand Up @@ -232,7 +247,7 @@ python -m pip install pip --upgrade

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

First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2, 11.1 or 11.3) <https://developer.nvidia.com/cuda-downloads>`_
First, if you have some Nvidia hardware with GPUs, install `CUDA (10.2 or 11.1) <https://developer.nvidia.com/cuda-downloads>`_
and `cuDNN <https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html>`_ to leverage them with pytorch and libtorch.

Then, install pytorch. Go to `pytorch.org <https://pytorch.org>`_ to retrieve the pip command that you
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ file(COPY "${PROJECT_SOURCE_DIR}/utils/github_actions/openeb/"
file(REMOVE_RECURSE "${OUTPUT_DIR}/cmake/custom_targets_metavision_sdk")
file(REMOVE "${OUTPUT_DIR}/cmake/custom_functions/create_addon_module_archive_folder.cmake")
file(REMOVE "${OUTPUT_DIR}/cmake/custom_functions/documentation.cmake")
# Remove unwanted plugins
file(REMOVE "${OUTPUT_DIR}/hal_psee_plugins/src/plugin/psee_gen4_evk1.cpp")
file(REMOVE "${OUTPUT_DIR}/hal_psee_plugins/src/plugin/psee_gen4_evk2.cpp")
file(REMOVE_RECURSE "${OUTPUT_DIR}/hal_psee_plugins/src/plugin/raven")
# Remove unwanted files
file(REMOVE "${OUTPUT_DIR}/sdk/cmake/MetavisionSDKCPackConfig.cmake")
file(REMOVE "${OUTPUT_DIR}/sdk/cmake/MetavisionStudioCPackConfig.cmake")
Expand Down
2 changes: 1 addition & 1 deletion hal/cpp/include/metavision/hal/facilities/i_ll_biases.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ class I_LL_Biases : public I_RegistrableFacility<I_LL_Biases> {

} // namespace Metavision

#endif // METAVISION_HAL_I_LL_BIASES_H
#endif // METAVISION_HAL_I_LL_BIASES_H
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int main(int argc, char *argv[]) {
const int fps = 25; // event-based cameras do not have a frame rate, but we need one for visualization
const int wait_time = static_cast<int>(std::round(1.f / fps * 1000)); // how much we should wait between two frames
cv::Mat display; // frame where events will be accumulated
const std::string window_name = "Metavision HAL Sync";
const std::string window_name = (mode_master) ? "Metavision HAL Sync - Master " : "Metavision HAL Sync - Slave ";
cv::namedWindow(window_name, cv::WINDOW_GUI_EXPANDED);
cv::resizeWindow(window_name, i_geometry->get_width(), i_geometry->get_height());

Expand Down
4 changes: 4 additions & 0 deletions hal_psee_plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/devices/gen4")
set(HAL_GEN4_SUPPORT TRUE)
endif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/devices/gen4")

if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/devices/raven")
set(HAL_RAVEN_SUPPORT TRUE)
endif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/src/devices/raven")

# Add libraries (plugins)
set(biasgen_calib_files_dir "${GENERATE_FILES_DIRECTORY}/biasgen_calib")
set(metavision_hal_psee_plugins_include_dir "${CMAKE_CURRENT_SOURCE_DIR}/include")
Expand Down
6 changes: 5 additions & 1 deletion hal_psee_plugins/include/boards/treuzell/tz_libusb.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
#ifndef METAVISION_HAL_TZ_LIBUSB_H
#define METAVISION_HAL_TZ_LIBUSB_H

#ifdef _MSC_VER
#define NOMINMAX // libusb.h includes windows.h which defines min max macros that we don't want
#endif

#include <system_error>
#include <libusb.h>
#include <libusb-1.0/libusb.h>

namespace Metavision {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,45 @@
* See the License for the specific language governing permissions and limitations under the License. *
**********************************************************************************************************************/

#if !defined(__ANDROID__) || defined(ANDROID_USES_LIBUSB)
#include "boards/fx3/fx3_camera_discovery.h"
#include "devices/gen4/gen4_evk1_facilities_builder.h"
#endif
#include "boards/rawfile/psee_file_discovery.h"
#include "devices/utils/device_system_id.h"
#include "metavision/hal/plugin/plugin.h"
#include "metavision/hal/plugin/plugin_entrypoint.h"
#include "metavision/hal/utils/hal_software_info.h"
#include "plugin/psee_plugin.h"

void initialize_plugin(void *plugin_ptr) {
using namespace Metavision;

Plugin &plugin = plugin_cast(plugin_ptr);
initialize_psee_plugin(plugin);

#if !defined(__ANDROID__) || defined(ANDROID_USES_LIBUSB)
// Register live camera discoveries
auto &fx3_disc = plugin.add_camera_discovery(std::make_unique<Fx3CameraDiscovery>());
fx3_disc.register_device_builder(SYSTEM_CCAM3_GEN4, build_gen4_evk1_device);
#endif

auto &file_disc = plugin.add_file_discovery(std::make_unique<PseeFileDiscovery>());
}
#ifndef METAVISION_HAL_IMX636_BIASES_H
#define METAVISION_HAL_IMX636_BIASES_H

#include <string>
#include <map>

#include "metavision/hal/facilities/i_ll_biases.h"

namespace Metavision {

static constexpr uint32_t BIAS_CONF = 0x11A10000;

class Imx636LLBias {
public:
Imx636LLBias(bool modifiable, std::string register_name, int sensor_offset, int current_value, int factory_default,
int min_offset, int max_offset);
~Imx636LLBias();
const std::string &get_register_name() const;
bool is_modifiable() const;
int get_min_offset();
int get_max_offset();
int get_current_offset();
void set_current_offset(const int val);
int get_current_value();
void set_current_value(const int val);
int get_factory_default_value();
void set_factory_default_value(const int val);
void display_bias();

private:
std::string register_name_;
bool modifiable_;
int current_value_;
int current_offset_;
int factory_default_;
int min_offset_;
int max_offset_;
};

} // namespace Metavision

#endif // METAVISION_HAL_IMX636_BIASES_H
10 changes: 5 additions & 5 deletions hal_psee_plugins/include/devices/imx636/imx636_evk2_issd.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace Metavision {

const std::vector<RegisterOperation> issd_evk2_imx636_init = {
static const std::vector<RegisterOperation> issd_evk2_imx636_init = {
RegisterOperation::Write(0x00000004, 0x00000111),
RegisterOperation::Write(0x00000000, 0x00000089),
RegisterOperation::Write(0x00000000, 0x0000008D),
Expand Down Expand Up @@ -138,7 +138,7 @@ const std::vector<RegisterOperation> issd_evk2_imx636_init = {
RegisterOperation::Write(0x00109000, 0x00000200)
};

const std::vector<RegisterOperation> issd_evk2_imx636_start = {
static const std::vector<RegisterOperation> issd_evk2_imx636_start = {
RegisterOperation::Write(0x00000044, 0x00000001),
RegisterOperation::Write(0x00000014, 0x00000001),
RegisterOperation::Write(0x0070F000, 0x00400001),
Expand All @@ -152,7 +152,7 @@ const std::vector<RegisterOperation> issd_evk2_imx636_start = {
RegisterOperation::WriteField(0x00000008, 0x0000004F, 0x1)
};

const std::vector<RegisterOperation> issd_evk2_imx636_stop = {
static const std::vector<RegisterOperation> issd_evk2_imx636_stop = {
RegisterOperation::Write(0x00000018, 0x00000000),
RegisterOperation::WriteField(0x00000008, 0x0000004E, 0x00000001),
// Analog STOP
Expand All @@ -166,7 +166,7 @@ const std::vector<RegisterOperation> issd_evk2_imx636_stop = {
RegisterOperation::Delay(300)
};

const std::vector<RegisterOperation> issd_evk2_imx636_destroy = {
static const std::vector<RegisterOperation> issd_evk2_imx636_destroy = {
// Analog DESTROY
RegisterOperation::Write(0x00100070, 0x00400008),
RegisterOperation::Write(0x0010006C, 0x0EE47114),
Expand Down Expand Up @@ -207,7 +207,7 @@ const std::vector<RegisterOperation> issd_evk2_imx636_destroy = {
RegisterOperation::Write(0x00000004, 0x00000000)
};

Issd issd_evk2_imx636_sequence = Issd{
static Issd issd_evk2_imx636_sequence = Issd{
issd_evk2_imx636_init,
issd_evk2_imx636_start,
issd_evk2_imx636_stop,
Expand Down
Loading

0 comments on commit 474368f

Please sign in to comment.