gstreamer/subprojects/gst-plugins-bad/ext/onnx
Olivier Crête 87ec3bd399 ssdobjectdetector: Add size threshold to drop too big detections
There is a known "failure" mode where the SSD detector finds an object
which is the whole frame. So skip objects which are "too big" to avoid
this.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6810>
2024-05-17 23:35:29 +00:00
..
decoders ssdobjectdetector: Add size threshold to drop too big detections 2024-05-17 23:35:29 +00:00
tensor onnx: Port SSD detector to C 2024-02-02 18:47:52 -05:00
gstml.h onnx: add gstonnxinference element 2023-10-20 00:33:29 +00:00
gstonnx.c onnx: add gstonnxinference element 2023-10-20 00:33:29 +00:00
gstonnxclient.cpp onnx: fix, update tensor producer and consumers 2024-02-05 22:27:59 -05:00
gstonnxclient.h onnx: Port SSD detector to C 2024-02-02 18:47:52 -05:00
gstonnxinference.cpp onnx: Add more tensor data types 2024-02-02 18:43:21 -05:00
gstonnxinference.h onnx: Remove enums file 2023-10-20 00:33:29 +00:00
meson.build onnx: Port SSD detector to C 2024-02-02 18:47:52 -05:00
README.md onnx: Update build instructions to use onnx-runtime 0.16.3 2023-12-22 14:43:23 -05:00

ONNX Build Instructions

Build

  1. do a recursive checkout of onnxruntime tag 1.16.3
  2. $SRC_DIR and $BUILD_DIR are local source and build directories
  3. To run with CUDA, both CUDA and cuDNN libraries must be installed.
$ cd $SRC_DIR
$ git clone --recursive https://github.com/microsoft/onnxruntime.git && cd onnxruntime && git checkout -b v1.16.3 refs/tags/v1.16.3
$ mkdir $BUILD_DIR/onnxruntime && cd $BUILD_DIR/onnxruntime

  1. CPU
$ cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install
  1. CUDA
cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF -Donnxruntime_USE_CUDA=ON -Donnxruntime_CUDA_HOME=/usr/local/cuda -Donnxruntime_CUDNN_HOME=/usr/local/cuda -DCMAKE_CUDA_ARCHITECTURES=native -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install
  1. Intel oneDNN

3.0 install intel oneDNN

3.1 clone, build and install Khronos OpenCL SDK. Build dependencies for Fedora are

sudo dnf install libudev-devel libXrandr-devel mesa-libGLU-devel mesa-libGL-devel libX11-devel intel-opencl

3.2 build and install onnxruntime :

cmake -Donnxruntime_BUILD_SHARED_LIB=ON -DBUILD_TESTING=OFF -Donnxruntime_BUILD_UNIT_TESTS=OFF -Donnxruntime_USE_DNNL=ON -Donnxruntime_DNNL_GPU_RUNTIME=ocl -Donnxruntime_DNNL_OPENCL_ROOT=$SRC_DIR/OpenCL-SDK/install  $SRC_DIR/onnxruntime/cmake && make -j$(nproc) && sudo make install