Skip to main content
Associate
July 11, 2026
Question

STM32MP257F-DK SSD MobileNet Object Detection: nn_post_proc() fails with official Model Zoo ONNX models + DCMIPP 300*300 stream configuration

  • July 11, 2026
  • 0 replies
  • 5 views

Hi ST Team,

We are developing a custom Qt 6 + OpenGL object detection application on the STM32MP257F-DK using OpenSTLinux 6.6, X-LINUX-AI, and the ONNX Runtime (stai_mpu) backend.

Our application architecture is based on the official ST object detection example. We use the same stai_mpu_wrapper and ssd_mobilenet_pp.hpp post-processing implementation from the stai_mpu_object_detection example, while replacing the GTK/Cairo UI with our own Qt/OpenGL application.

Application Architecture

  • Board: STM32MP257F-DK

  • OS: OpenSTLinux 6.6

  • AI Backend: ONNX Runtime (libstai_mpu_ort.so.6)

  • Camera: libcamera + DCMIPP

  • Display: Qt 6 + OpenGL (Wayland/Weston)

  • Camera Pipeline:

    • Viewfinder stream → RGB565 → OpenGL live preview

    • AI stream → RGB888 → STAI inference

  • Inference: stai_mpu_wrapper::RunInference()

  • Post-processing: Official ssd_mobilenet_pp.hpp from the ST stai_mpu_object_detection example.

 

1. DCMIPP camera configuration issue

Our AI model requires a 300×300 RGB888 input, so we configured:

cfg_npu.size.width  = 300;
cfg_npu.size.height = 300;
cfg_npu.pixelFormat = libcamera::formats::RGB888;

However, camera->configure() fails with:


ERROR DCMIPP dcmipp_path.cpp:448 Unable to configure capture in 300x300-RGB888 got instead: 304x300-BGR3
ERROR DCMIPP dcmipp.cpp:677 Failed to configure path
[04:14:22] ❌ CRITICAL: camera->configure failed with error code: -22

Changing the stream to 304×300 RGB888 allows the pipeline to start successfully.

Current workaround:

  • Capture at 304×300

  • Remove the extra 4 pixels & changing BGR3 to RGB888 in software

  • Feed a 300×300 tensor to the AI model

Question:

Is the 304-pixel width a mandatory DCMIPP alignment requirement, or is there an ISP/DCMIPP configuration that can output a true 300×300 RGB888 image without software cropping?

 

 

2. SSD MobileNet post-processing failure

Before implementing our application, we evaluated the STM32AI Model Zoo object detection models supported for STM32MP25.

Initially, we explored the available YOLO models (YOLOv2, YOLOv5, YOLOv8, etc.). However, since the current ST object detection reference application (stai_mpu_object_detection) and its associated post-processing implementation (ssd_mobilenet_pp.hpp) are designed specifically for SSD MobileNet, we decided to first integrate the officially supported SSD workflow before extending our application to other architectures.

From the Model Zoo, we therefore tested the official SSD models:

  • ssd_mobilenetv1_pt_coco_300_qdq_int8.onnx
  • ssd_mobilenetv2_pt_coco_300_qdq_int8.onnx

We also noticed that the current ssd_mobilenet_pp.hpp provides decoding support for SSD MobileNet V1 and SSD MobileNet V2 only. There is currently no equivalent post-processing implementation for SSD MobileNet V3 or other object detection architectures in the reference example.

Inference status

The inference pipeline itself executes successfully.

  • Camera capture works correctly.
  • Image preprocessing completes successfully.
  • stai_mpu_wrapper::RunInference() executes successfully.
  • ONNX Runtime loads the model correctly.
  • ONNX Runtime returns valid output tensors.

The failure occurs only during the official ST post-processing stage:

nn_postproc::nn_post_proc(...)

Runtime error:

[ORT] Failed: Index exceeding number of outputs.

Output inspection

To verify the model outputs, we inspected the ONNX model directly using ONNX Runtime:

sess.get_outputs()

Both official Model Zoo SSD models return exactly two outputs:

Output 0
Shape = [1,3000,81]

Output 1
Shape = [1,3000,4]

However, the official ssd_mobilenet_pp.hpp used in the ST object detection example expects three outputs:

get_output(0) -> class predictions
get_output(1) -> box encodings
get_output(2) -> anchors

Since the third output is not present in these official Model Zoo ONNX models, the following call fails:

nn_model->get_output(2);

resulting in:

[ORT] Failed: Index exceeding number of outputs.

 

Questions

 

  1. What is the standard library used to decode different types of YOLO output tensors in an embedded framework ?

  2. Are the current STM32AI Model Zoo SSD ONNX models intentionally exported with only two outputs?

  3. Is there an updated version of ssd_mobilenet_pp.hpp compatible with these SSD MobileNet ONNX models?

  4. Is there an official 256×256 SSD MobileNet model (or recommended anchor configuration) for STM32MP25?

  5. Is the 304×300 RGB888 DCMIPP configuration expected, or should a true 300×300 RGB888 stream be supported?

Our long-term objective is to build a generic object detection framework supporting SSD MobileNet, SSDLite, and YOLO models on STM32MP25 while remaining compatible with the X-LINUX-AI ecosystem.

Any guidance or updated reference implementation from the ST engineering team would be greatly appreciated.

Thank you.