Skip to content

Commit aec4c37

Browse files
authored
FFI Support (#18)
This PR adds FFI (Foreign Function Interface) support to gst-plugin-edgeimpulse, enabling direct integration with the Edge Impulse C++ SDK via the `edge-impulse-ffi-rs` crate. This brings significant improvements to build flexibility, performance, and deployment options for GStreamer-based AI inference pipelines. # Key Features ## FFI Mode (Default): * Direct, statically-linked inference using the Edge Impulse C++ SDK. * Models are compiled into the binary at build time for faster startup and inference. * No need to provide a .eim model file at runtime. * Supports all advanced hardware accelerators and backends available in the FFI SDK. * Controlled via environment variables (`EI_PROJECT_ID`, `EI_API_KEY`, or `EI_MODEL`). ## EIM Mode (Legacy): * Continues to support .eim model files for maximum compatibility. * Selectable via Cargo features (--no-default-features --features eim). # Why FFI Support? * Performance: Direct C++ SDK integration reduces inference latency and startup time. * Flexibility: Supports a wider range of hardware accelerators and deployment targets. * Simplicity: No need to manage .eim files at runtime in FFI mode. * Future-Proof: Aligns with the latest Edge Impulse SDK capabilities and deployment best practices. # Migration Notes * Default Mode: The plugin now defaults to FFI mode. To use EIM mode, build with --no-default-features --features eim. * Environment Variables: FFI mode requires `EI_PROJECT_ID` and `EI_API_KEY` (or `EI_MODEL`) to be set at build time. * Model Switching: When changing models, run cargo clean and clear the cargo cache to avoid stale artifacts.
1 parent 8d0263a commit aec4c37

File tree

14 files changed

+2274
-719
lines changed

14 files changed

+2274
-719
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
run: cargo fmt -- --check
5656

5757
- name: Build
58-
run: cargo build --verbose
58+
run: cargo build --no-default-features --features eim --verbose
5959

6060
- name: Run tests
61-
run: cargo test --verbose
61+
run: cargo test --no-default-features --features eim --verbose

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: dtolnay/rust-toolchain@stable
4747

4848
- name: Build Documentation
49-
run: cargo doc --no-deps
49+
run: cargo doc --no-default-features --features eim --no-deps
5050

5151
- name: Add index.html redirect
5252
run: |

0 commit comments

Comments
 (0)