Video length is 2:23

YOLOv11 LiteRT Code Generation with MATLAB Coder

Learn how to use MATLAB Coder™ to generate optimized C/C++ code for the YOLOv11 LiteRT model. YOLOv11 is a state-of-the-art real-time object detection and instance segmentation model that predicts object bounding boxes, class labels, and segmentation masks from an input image.

The workflow begins by loading the pretrained LiteRT model into MATLAB®. You then run and test the model in MATLAB to verify that it produces the expected detection and segmentation results. Once you have validated the algorithm, use MATLAB Coder to generate standalone C/C++ code for CPU deployment or GPU Coder™ to generate CUDA® code optimized for NVIDIA® GPUs.

The generated standalone source code includes the complete inference pipeline, from image preprocessing and neural network execution to postprocessing. It resizes and normalizes the input image, executes the lowered YOLOv11 network, decodes the detection outputs, applies multiclass non-maximum suppression, reconstructs the instance segmentation masks, and generates the final annotated output image.

The generated standalone source code is readable, portable, and, by default, independent of Python® and third-party software. You can integrate the generated code into existing applications as source code, static libraries, or dynamic libraries. You can further optimize the generated code by enabling multicore execution, vectorization, or hardware-optimized libraries for your target platform.

Whether you are deploying applications to desktop systems or embedded hardware, this workflow provides an efficient path from pretrained TensorFlow™ and LiteRT models to production-ready code.

Published: 10 Jul 2026