Commit aec4c37
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- .github/workflows
- examples
- src
- audio
- overlay
- video
14 files changed
+2274
-719
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
| 49 | + | |
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| |||
0 commit comments