Pose Estimation deployment ¶
Pose Estimation deployment is supported on STM32N6 and STM32MPU platforms. It is not supported on STM32H7. Hardware requirements, supported model formats, tools, and deployment steps vary by target. Follow the guide for your platform for the applicable setup instructions and configuration:
Pose Estimation specifics ¶
The model to deploy is a quantized
.tflitemodel or a QDQ.onnxmodel, given withmodel_pathor selected by name as in the example files.model.model_typeis required, also when you usemodel_path.Supported
model_typevalues:heatmaps_speandyolo_mpeon STM32N6 (any other value stops the deployment), andyolo_mpeon STM32MPU, whose application code implements the YOLOv8 pose post-processing.Set
dataset.class_namesto[person],[hand], or[head], withdataset.keypointsforyolo_mpe: the first class name and the number of keypoints select the skeleton that the application draws. If the skeleton is unknown, only the keypoints are drawn; define your own withdataset.skeleton_connections(see the Datasets guide).The
postprocessingsection is used on STM32N6 to generate the application configuration:kpts_conf_threshis required, for both model types. It is the confidence threshold above which a keypoint is drawn.confidence_thresh,NMS_thresh, andmax_detection_boxesare also required foryolo_mpe. Highermax_detection_boxesvalues use more memory on target.
The STM32MPU deployment does not forward the
postprocessingvalues to the board.The
preprocessingsection needsresizingandcolor_mode;rescalingis optional for deployment. Supported values depend on the target:Attribute
STM32N6
STM32MPU
resizing.aspect_ratiofitorcropfitcolor_modergbrgbOn STM32MPU, the examples use
bilinearinterpolation, the only one supported by the current MPU applications.STM32N6: the application code
application_code/pose_estimation/STM32N6is a Git submodule. Initialize it from the repository root before deploying:git submodule update --init application_code/pose_estimation/STM32N6STM32MPU:
dataset.keypoints_file_pathis required. It is the text file with the keypoint names that the application loads; the example useskeypoints_yolov8.txtof the application code, which documents the STM32MP257F-EV1 board. Also setdeployment.hardware_setup.ip_addressto the IP address of the board.
Configuration examples ¶
Ready-to-use YAML examples are available in the Pose Estimation configuration folder:
STM32N6 deployment:
STM32MPU deployment: deployment_mpu_config.yaml
Quantization followed by deployment (
chain_qd): chain_qd_config.yaml, which targets the STM32N6570-DK board. In this chain, setresizing.aspect_ratiotofit: the calibration images are read by the dataset loader, which does not acceptcrop.
For the STM32N6570-DK, run the deployment from the
pose_estimation/
folder, for example:
python stm32ai_main.py --config-path ./config_file_examples/ --config-name deployment_n6_st_movenet_lightning_heatmaps_config.yaml
When it runs, the board displays the camera stream, the inference time, and the detected poses.