Instance Segmentation deployment ¶
Instance Segmentation deployment is supported on STM32N6 only, on the STM32N6570-DK and NUCLEO-N657X0-Q boards. Hardware requirements, tools, and deployment steps are described in the shared guide: STM32N6 deployment guide.
For the application code, initialize the Instance Segmentation submodule from the root of the repository, then set
deployment.c_project_path
to its path relative to the
instance_segmentation/
folder:
git submodule update --init application_code/instance_segmentation/STM32N6
Instance Segmentation specifics ¶
Only quantized TFLite (
.tflite) models are supported. Instance Segmentation has no quantization service: deploy a quantized model, such as a pretrainedw8a8_ptqmodel of the zoo.model.model_typemust beyolov8n_seg. It selects the YOLOv8 segmentation postprocessing of the embedded application, and any other value stops the deployment.Use the same launch command as the shared guide with the Instance Segmentation example configuration:
python stm32ai_main.py --config-path ./config_file_examples/ --config-name deployment_n6_yolov8n_seg_config.yamlKeep the
hydraandmlflowsections of the example (./experiments_outputs/...).The
datasetsection must provide the class names, withclasses_file_pathorclass_names. They are written in the application header file.The
postprocessingsection is required and must containconfidence_thresh,NMS_thresh, andmax_detection_boxes. They are written in the application header file. Highermax_detection_boxesvalues use more memory on target; the example uses10.preprocessingrequiresresizingandcolor_mode;rescalingis not used.color_modeisrgborbgr.resizing.aspect_ratioisfit,crop, orfull_screen, andresizing.interpolationis required withfit. The example usescrop.deployment.hardware_setup.output(UVCLorSPI) is only accepted for the NUCLEO-N657X0-Q board.When the application runs, the display shows the camera stream, the inference time, the bounding boxes, the number of detected objects, and the segmentation masks.
The
chain_qdoperation mode is not supported.
Configuration example ¶
A ready-to-use YAML example is available in the Instance Segmentation configuration folder:
STM32N6 deployment: deployment_n6_yolov8n_seg_config.yaml. Set
deployment.hardware_setup.boardto the board you use.