13 releases (1 stable)

1.0.0 Oct 6, 2022
0.9.1 Sep 27, 2022
0.8.1 Sep 22, 2022

#200 in #deployment

Download history 1/week @ 2024-08-08 20/week @ 2024-09-19 8/week @ 2024-09-26

455 downloads per month
Used in mmdeploy

Apache-2.0

13KB
233 lines

rust-mmdeploy-sys

MMDeploy bindings for Rust.

This repo is a low-level MMDeploy abstraction, you can use rust-mmdeploy directly if you want to use MMDeploy in Rust. If it cannot cover your requirements, it's easy to build high-level abstraction based on this repo.

Support matrix from MMDeploy

Supporting all devices and platforms is a big challenge for this personal project. So I just support and test for main devices and platforms.

Supported : ✔️ MMDeploy not support : - Uncertain (without test): ❓

Device / Platform Linux Windows macOS Android
x86_64 CPU ✔️ONNX Runtime
❓pplnn
❓ncnn
❓OpenVINO
❓LibTorch
❓ONNX Runtime
❓OpenVINO
- -
ARM CPU ❓ncnn - - ❓ncnn
RISC-V ❓ncnn - - -
NVIDIA GPU ✔️ONNX Runtime
✔️TensorRT
❓pplnn
❓LibTorch
❓ONNX Runtime
❓TensorRT
❓pplnn
- -
NVIDIA Jetson ❓TensorRT ❓TensorRT - -
Huawei ascend310 ❓CANN - - -
Rockchip ❓RKNN - - -
Apple M1 - - ❓CoreML -
Adreno GPU - - - ❓ncnn
❓SNPE
Hexagon DSP - - - ❓SNPE

Prerequisites

In order to successfully build this repo, you are supposed to install some pre-packages.

Step 1. Install Clang required by Bindgen.

apt install llvm-dev libclang-dev clang

Step 2.1. (For ONNXRuntime) Download and install pre-built mmdeploy package and ONNXRuntime.

wget https://github.com/open-mmlab/mmdeploy/releases/download/v0.9.0/mmdeploy-0.9.0-linux-x86_64-onnxruntime1.8.1.tar.gz
tar -zxvf mmdeploy-0.9.0-linux-x86_64-onnxruntime1.8.1.tar.gz
cd mmdeploy-0.9.0-linux-x86_64-onnxruntime1.8.1
export MMDEPLOY_DIR=$(pwd)/sdk

wget https://github.com/microsoft/onnxruntime/releases/download/v1.8.1/onnxruntime-linux-x64-1.8.1.tgz
tar -zxvf onnxruntime-linux-x64-1.8.1.tgz
cd onnxruntime-linux-x64-1.8.1
export ONNXRUNTIME_DIR=$(pwd)
export LD_LIBRARY_PATH=$ONNXRUNTIME_DIR/lib:$LD_LIBRARY_PATH

Step 2.2. (For TensorRT) Download and install pre-built mmdeploy package and TensorRT.

wget https://github.com/open-mmlab/mmdeploy/releases/download/v0.9.0/mmdeploy-0.9.0-linux-x86_64-cuda11.1-tensorrt8.2.3.0.tar.gz
tar -zxvf mmdeploy-0.9.0-linux-x86_64-cuda11.1-tensorrt8.2.3.0.tar.gz
cd mmdeploy-0.9.0-linux-x86_64-cuda11.1-tensorrt8.2.3.0
export MMDEPLOY_DIR=$(pwd)/sdk

Quick start

Update your Cargo.toml

mmdeploy-sys = "1.0.0"

Build

Move to the root of this repo and then:

cargo build

No runtime deps

~0–1.9MB
~36K SLoC