A custom Edge Impulse deployment block (enterprise) that packages a trained impulse into an ExecuTorch program (.pte) with a small Python runtime harness.
Because ExecuTorch consumes PyTorch programs while Edge Impulse emits TensorFlow/TFLite/ONNX, the block converts the exported ONNX model to PyTorch (via onnx2torch) and lowers it to a .pte with the chosen backend. If conversion tooling is unavailable, it still packages model.onnx plus a conversion note so a deploy never hard-fails.
repo - https://github.com/edgeimpulse/executorch-android-app
Sample apks - https://github.com/edgeimpulse/executorch-android-app/releases/edit/v1.0.0-samples
| File | Purpose |
|---|---|
parameters.json |
Deploy block metadata + the backend selector shown in Studio. |
build.py |
Entrypoint. Reads deployment-metadata.json, converts, and writes deploy.zip. |
app/run_pte.py |
Runtime harness: loads a .pte and runs one forward pass. |
app/convert.py |
Offline ONNX → .pte converter (same logic as the block). |
Dockerfile |
Builds the block container. |
requirements.txt |
Pinned dependencies (onnx, onnx2torch, torch, executorch). |
- Input (
--metadata):deployment-metadata.json, which points tofolders.input(SDK + trained model in several formats) andfolders.output. - Parameter:
--backend(xnnpackorportable). - Output:
deploy.zipinfolders.output, containingmodel.pte(when converted),model.onnx,labels.txt, and theapp/harness.
# Download the deployment inputs for a project into ./input
edge-impulse-blocks runner --download-data input/
docker build -t executorch-deploy .
docker run --rm -v "$PWD":/home executorch-deploy \
--metadata /home/input/deployment-metadata.jsonThe resulting deploy.zip is written to the output directory reported in the metadata.
edge-impulse-blocks init # first time only; choose "Deployment block"
edge-impulse-blocks pushIt then appears as a Custom block option on the project Deployment page.
This is an MVP. The ONNX → PyTorch → ExecuTorch path works for common CNN graphs; exotic ops may need a custom partitioner or manual conversion via app/convert.py. Validate on your target model before relying on it in production.