|
STM32N6 NPU Deployment — Politecnico di Milano
1.0
Documentation for Neural Network Deployment on STM32N6 NPU - Politecnico di Milano 2024-2025
|
The ST Model Zoo is a public GitHub repository maintained by STMicroelectronics containing a curated collection of pre-trained neural network models, all validated for deployment on STM32 devices.
🔗 github.com/STMicroelectronics/stm32ai-modelzooTraining a neural network from scratch requires large datasets, powerful GPUs, and days of computation. For most embedded AI projects — including this one — this is neither necessary nor practical. The Model Zoo solves this by providing models that are already trained, quantized, and validated on reference STM32 hardware. You download the model file and proceed directly to deployment.
As of release 4.0, the Model Zoo supports three frameworks — TensorFlow, PyTorch, and ONNX — and provides performance benchmarks on both MCU and MPU targets for every model.
The repository is organised by application domain. Each folder contains multiple model architectures, each pre-trained on public datasets. Within each domain, models are further organised by training source.
| Subfolder | Description |
|---|---|
| ST_pretrainedmodel_public_dataset | Models trained by ST on public datasets (e.g. COCO). Best validated option. |
| ST_pretrainedmodel_custom_dataset | Models trained by ST on custom / proprietary datasets. |
| Public_pretrainedmodel_public_dataset | Public models (e.g. Google MoveNet) on public datasets. |
The table below shows all supported use cases and which STM32 board is recommended for each. Notice that the STM32N6570-DK supports the widest range of use cases — a direct consequence of its Neural-ART NPU.
| Use Case | Description | STM32N6570-DK |
|---|---|---|
| Image Classification | Classifies content within predefined classes | ✓ |
| Object Detection | Detects and locates objects in images | ✓ |
| Pose Estimation ← this project | Detects keypoints on people (hands, face, body) | Recommended |
| Semantic Segmentation | Labels every pixel in an image | ✓ |
| Instance Segmentation | Labels pixels per object instance | ✓ |
| Depth Estimation | Pixel-wise depth map from image | ✓ |
| Neural Style Transfer | Applies artistic style to images | ✓ |
| Speech Enhancement | Audio enhancement in noisy environments | ✓ |
| Re-Identification | Reidentifies person/object across frames | ✓ |
The pose_estimation/ folder contains five model families:
The following data comes directly from the Model Zoo README — these are the official ST benchmarks for the model we deployed. Our measured results (22 ms at 192×192) are consistent with these figures.
| Model | Resolution | Format | Internal RAM (KiB) | Weights Flash (KiB) |
|---|---|---|---|---|
| ST MoveNet Lightning heatmaps | 192×192×3 | Int8 | 914.88 | 2304.0 |
| ST MoveNet Lightning heatmaps | 224×224×3 | Int8 | 1239.04 | 2304.0 |
| ST MoveNet Lightning heatmaps | 256×256×3 | Int8 | 1607.68 | 2304.0 |
| Model | Resolution | Inference (ms) | Inf/sec | STEdgeAI version |
|---|---|---|---|---|
| ST MoveNet Lightning heatmaps | 192×192×3 | 22.05 ms | 45.35 | 3.0.0 |
| ST MoveNet Lightning heatmaps | 224×224×3 | 27.64 ms | 36.18 | 3.0.0 |
| ST MoveNet Lightning heatmaps | 256×256×3 | 35.50 ms | 28.17 | 3.0.0 |
| Model | Resolution | Quantization | OKS (%) |
|---|---|---|---|
| ST MoveNet Lightning heatmaps | 192×192 | per-channel | 57.64% |
| ST MoveNet Lightning heatmaps | 224×224 | per-channel | 62.29% |
| ST MoveNet Lightning heatmaps | 192×192 | per-tensor | 55.84% |
| MoveNet Lightning (Google) | 192×192 | per-channel | 54.12% |
The repo uses Git LFS for large binary files (model weights). You must install and initialise Git LFS before cloning, otherwise model files will download as empty pointers.
stm32ai-modelzoo-services. The config file examples in Services
reference model paths relative to this structure. If the folders are not
siblings, you will need to update every model_path in
user_config.yaml manually.
| Model | Source | Format | Zoo? | Quantization needed? |
|---|---|---|---|---|
| MoveNet Lightning | ST Model Zoo | .tflite INT8 | Yes | No — pre-quantized |
| YOLOv8n-pose | Ultralytics (external) | .pt → .tflite | No | Yes — PTQ via TFLite |
| TinyBERT | HuggingFace (external) | .onnx | No | Yes — PTQ required |
user_config.yaml.
The Services framework handles everything else — quantization if needed,
profiling, and deployment. That is what we look at in the next section.