YOLOv11 LiteRT: C/C++ generation with MATLAB Coder

Learn to test YOLOv11 segmentation in MATLAB and generate standalone C/C++ code that includes image preprocessing and postprocessing.

Player not loading? Watch on YouTube

This tutorial covers a YOLOv11 LiteRT instance segmentation workflow in MATLAB, followed by standalone C/C++ generation with MATLAB Coder. The example starts with a model trained on the COCO dataset and a test image. The speaker walks through loading the model and calling its invoke method to run inference.

The network expects a fixed image size, so the algorithm resizes and formats the input before inference. Postprocessing draws bounding boxes, class labels and segmentation masks for detected objects. Running the algorithm in MATLAB gives the presenter a way to visually check the output before generating code from the same algorithm.

The generated inference pipeline includes both preprocessing and postprocessing. The code walkthrough shows network weights loading from binary files into memory during initialization. Each inference prepares a normalized input tensor, executes the segmentation network and reconstructs detections using predicted boxes, class scores, mask coefficients and prototype masks.

The speaker says the generated code runs without Python or third-party software libraries and can be integrated into existing applications. The supplied description identifies CPU deployment through MATLAB Coder and CUDA generation for NVIDIA GPUs through GPU Coder. The example concerns on-device object detection and segmentation; it does not provide hardware requirements or performance measurements.

The demonstration requires commercial MATLAB and its code generation products; the open-source LiteRT runtime does not itself include those licenses.