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 .tflite model or a QDQ .onnx model, given with model_path or selected by name as in the example files. model.model_type is required, also when you use model_path.

  • Supported model_type values: heatmaps_spe and yolo_mpe on STM32N6 (any other value stops the deployment), and yolo_mpe on STM32MPU, whose application code implements the YOLOv8 pose post-processing.

  • Set dataset.class_names to [person], [hand], or [head], with dataset.keypoints for yolo_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 with dataset.skeleton_connections (see the Datasets guide).

  • The postprocessing section is used on STM32N6 to generate the application configuration:

    • kpts_conf_thresh is required, for both model types. It is the confidence threshold above which a keypoint is drawn.

    • confidence_thresh, NMS_thresh, and max_detection_boxes are also required for yolo_mpe. Higher max_detection_boxes values use more memory on target.

  • The STM32MPU deployment does not forward the postprocessing values to the board.

  • The preprocessing section needs resizing and color_mode; rescaling is optional for deployment. Supported values depend on the target:

    Attribute

    STM32N6

    STM32MPU

    resizing.aspect_ratio

    fit or crop

    fit

    color_mode

    rgb

    rgb

    On STM32MPU, the examples use bilinear interpolation, the only one supported by the current MPU applications.

  • STM32N6: the application code application_code/pose_estimation/STM32N6 is a Git submodule. Initialize it from the repository root before deploying:

    git submodule update --init application_code/pose_estimation/STM32N6
    
  • STM32MPU: dataset.keypoints_file_path is required. It is the text file with the keypoint names that the application loads; the example uses keypoints_yolov8.txt of the application code, which documents the STM32MP257F-EV1 board. Also set deployment.hardware_setup.ip_address to the IP address of the board.

Configuration examples

Ready-to-use YAML examples are available in the Pose Estimation configuration folder:

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.