espressif/esp-dl
Espressif deep-learning library for AIoT applications
ESP‑DL – Tiny‑Device Neural‑Network Inference
What it is
- A lightweight inference engine built by Espressif for its ESP‑Series microcontrollers (e.g., ESP32‑S3, ESP32‑P4).
- Turns a trained model (from PyTorch, TensorFlow, ONNX) into a compact
.espdlfile that can run directly on the chip with very little RAM and CPU.
Why it matters
- Brings on‑device AI to ultra‑low‑power, cost‑effective hardware that is normally used for IoT, wearables, and edge sensors.
- Enables real‑time vision, audio, or sensor‑fusion inference without needing a separate accelerator.
Key capabilities
| Feature | What it does |
|---|---|
| Standard model format | Uses FlatBuffers (.espdl) for zero‑copy loading, much smaller than ONNX protobuf. |
| Mixed‑precision quantization | Supports 8‑bit, 16‑bit, and mixed w8a16 quantization, selectable per‑layer to keep accuracy while cutting compute. |
| Operator set | Core ops like Conv, DepthwiseConv, Gemm, Add, Mul, Pooling, Resize, Reduce, Transpose, plus 8‑bit LUT activations. |
| Static memory planner | Automatically places tensors in the optimal RAM region based on the user‑specified internal RAM budget, minimizing peak usage. |
| Dual‑core scheduling | Runs heavy ops (Conv2D, DepthwiseConv2D) on both ESP32 cores for up to ~2× speed‑up. |
| 8‑bit LUT activations | All activations except ReLU/PReLU are evaluated via a lookup table, keeping compute constant regardless of function complexity. |
| Tooling | esp-ppq quantizer (converts ONNX/PyTorch/TensorFlow → .espdl), AutoQuant, and AI‑agent “skills” that can auto‑tune quantization or rewrite code for SIMD acceleration. |
| Model zoo | Pre‑quantized MobileNetV2, YOLO11/26, PP‑OCRv6, and other vision/audio models packaged as ESP‑IDF components. |
| Documentation & demos | Full docs, tutorials, and example projects for loading, debugging, and running models on ESP‑IDF. |
Typical workflow
- Train a model in your favourite framework (PyTorch, TensorFlow, etc.).
- Export to ONNX.
- Quantize with
esp-ppq(choose per‑tensor or per‑channel, mixed‑precision, AutoQuant, etc.). - Convert to
.espdl(flat‑buffer file). - Add the model component to an ESP‑IDF project and call the ESP‑DL API to load and run inference.
Who would use it
- IoT developers who want to add vision (object detection, OCR), keyword spotting, or anomaly detection to ESP‑based devices.
- Robotics hobbyists building low‑cost edge perception on micro‑controllers.
- Researchers prototyping ultra‑low‑power AI pipelines and needing a reproducible, open‑source inference stack.
Getting started
- Install ESP‑IDF
v5.3+. - Install the quantizer:
pip install torch torchvision torchaudio && pip install esp-ppq. - Follow the official docs (link in README) for a “Hello‑World” model load and inference example.
- Browse the
models/folder for ready‑made components you can drop into your project.
Community & support
- Open issues on the GitHub repo for missing operators or bugs.
- Contributions welcome: add new operators, improve kernels, or extend the model zoo.
- Espressif maintains a component registry where ESP‑DL components are published for easy reuse.
All information above is taken directly from the repository’s README and linked documentation.
Related
- Project
- Project
- Project
- Project
- Dispatch