X-LINUX-AI v2.0.0 is officially delivered on top of the OpenSTLinux v2.0.0 but it also supports OpenSTLinux v1.2.0.
This article explains how to use and rebuild X-LINUX-AI v2.0.0 on an OpenSTLinux v1.2.0 distribution. For more detailed information about X-LINUX-AI Expansion Package, refer to X-LINUX-AI OpenSTLinux Expansion Package.
1. Validated hardware[edit source]
As any software expansion package, X-LINUX-AI is supported on all STM32MP1 Series. It has been validated on the following boards:
2. Installing X-LNUX-AI from OpenSTLinux AI package repository[edit source]
All the generated X-LINUX-AI packages are available from the OpenSTLinux AI package repository service hosted at the non-browsable URL http://extra.packages.openstlinux.st.com/AI.
This repository contains AI packages that can be simply installed using apt-* utilities. These utilities are the same as the ones used on a Debian system:
- the main group contains the selection of AI packages whose installation is automatically tested by STMicroelectronics
- the updates group is reserved for future use like package revision update.
You can install them individually or by group of packages.
2.1. Prerequisites[edit source]
- The Starter Package must be flashed on your SD card
- Your board must have an internet connection either through the network cable or through a WiFi connection.
2.2. Configuring AI OpenSTLinux package repository[edit source]
Once the board is booted, execute the following command from the console to configure the AI OpenSTLinux package repository:
wget http://extra.packages.openstlinux.st.com/AI/1.2/pool/config/a/apt-openstlinux-ai/apt-openstlinux-ai_1.0_armhf.deb
apt-get install ./apt-openstlinux-ai_1.0_armhf.deb
Then synchronize the AI OpenSTLinux package repository.
apt-get update
2.3. Installing AI packages[edit source]
2.3.1. Installing all X-LINUX-AI packages[edit source]
Command | Description |
---|---|
apt-get install packagegroup-x-linux-ai |
This command installs all the X-LINUX-AI packages (TensorFlow Lite, Edge TPU, armNN, application samples and tools) |
[edit source]
Command | Description |
---|---|
apt-get install packagegroup-x-linux-ai-tflite |
This command installs X-LINUX-AI packages related to TensorFlow Lite framework (including application samples) |
apt-get install packagegroup-x-linux-ai-tflite-edgetpu |
This command installs X-LINUX-AI packages related to the Edge TPU framework (including application samples) |
apt-get install packagegroup-x-linux-ai-armnn-tflite |
This command installs X-LINUX-AI packages related to the armNN framework (including application samples) |
2.3.3. Installing individual packages[edit source]
Command | Description |
---|---|
apt-get install arm-compute-library |
This command installs Arm Compute Library (ACL) |
apt-get install arm-compute-library-tools |
This command installs Arm Compute Library utilities (graph examples and benchmarks) |
apt-get install armnn |
This command installs arm Neural Network SDK (armNN) |
apt-get install armnn-tensorflow-lite |
This command installs armNN TensorFlow Lite parser |
apt-get install armnn-tensorflow-lite-examples |
This command installs armNN TensorFlow Lite examples |
apt-get install armnn-tfl-benchmark |
This command installs armNN benchmark application for TensorFlow Lite models |
apt-get install armnn-tfl-cv-apps-image-classification-c++ |
This command installs C++ image classification example using armNN TensorFlow Lite parser |
apt-get install armnn-tfl-cv-apps-object-detection-c++ |
This command installs C++ object detection example using armNN TensorFlow Lite parser |
apt-get install armnn-tools |
This command installs armNN utilitites such as unitary tests |
apt-get install libedgetpu1 |
This command installs Edge TPU libraries and the USB rules |
apt-get install python3-tensorflow-lite |
This command installs Python TensorFlow Lite inference engine |
apt-get install python3-tensorflow-lite-edgetpu |
This command installs Python TensorFlow Lite inference engine for Edge TPU |
apt-get install tensorflow-lite-tools |
This command installs Tensorflow Lite utilities |
apt-get install tflite-cv-apps-edgetpu-image-classification-c++ |
This command installs C++ image classification example using Coral Edge TPU TensorFlow Lite API |
apt-get install tflite-cv-apps-edgetpu-image-classification-python |
This command installs Python image classification example using Coral Edge TPU TensorFlow Lite API |
apt-get install tflite-cv-apps-edgetpu-object-detection-c++ |
This command installs C++ object detection example using Coral Edge TPU TensorFlow Lite API |
apt-get install tflite-cv-apps-edgetpu-object-detection-python |
This command installs Python object detection example using Coral Edge TPU TensorFlow Lite API |
apt-get install tflite-cv-apps-image-classification-c++ |
This command installs C++ image classification using TensorFlow Lite |
apt-get install tflite-cv-apps-image-classification-python |
This command installs Python image classification example using TensorFlow Lite |
apt-get install tflite-cv-apps-object-detection-c++ |
This command installs C++ object detection example using TensorFlow Lite |
apt-get install tflite-cv-apps-object-detection-python |
This command installs Python object detection example using TensorFlow Lite |
apt-get install tflite-edgetpu-benchmark |
This command installs benchmark application for Edge TPU models |
apt-get install tflite-models-coco-ssd-mobilenetv1 |
This command installs TensorFlow Lite COCO SSD Mobilenetv1 model |
apt-get install tflite-models-coco-ssd-mobilenetv1-edgetpu |
This command installs TensorFlow Lite COCO SSD Mobilenetv1 model for Edge TPU |
apt-get install tflite-models-mobilenetv1 |
This command installs TensorFlow Lite Mobilenetv1 model |
apt-get install tflite-models-mobilenetv1-edgetpu |
This command installs TensorFlow Lite Mobilenetv1 model for Edge TPU |
3. Re-generating X-LINUX-AI OpenSTLinux distribution[edit source]
Use the following procedure to re-generate the complete distribution and enable the X-LINUX-AI expansion package.
This procedure is mandatory if you need to update by yourself some frameworks or modify the application samples.
For more details, expand the contents:
3.1. Downloading the STM32MP1 Distribution Package v1.2.0[edit source]
Install the STM32MP1 Distribution Package v1.2.0, but do not initialize the OpenEmbedded environment (do not source the envsetup.sh).
3.1.1. Cloning the meta-st-stm32mpu-ai git repositories[edit source]
cd <Distribution Package installation directory>/layers/meta-st git clone https://github.com/STMicroelectronics/meta-st-stm32mpu-ai.git -b v2.0.0_thud
3.2. Setting up the build environment[edit source]
cd ../.. DISTRO=openstlinux-weston MACHINE=stm32mp1 source layers/meta-st/scripts/envsetup.sh
3.3. Adding the new layers to the build system[edit source]
bitbake-layers add-layer ../layers/meta-st/meta-st-stm32mpu-ai
3.4. Building the image[edit source]
bitbake st-image-ai
3.5. Flashing the built image[edit source]
Follow this link to know how to flash the built image.
4. References[edit source]