This article aims to give general information about the x-linux-ai-application. presenting its core features, potential applications, and benefits to users seeking to leverage its capabilities within STM32MPU.
1. Description[edit source]
The X-LINUX-AI Application is an advanced software solution crafted to enhance the management and utilization of AI (Artificial Intelligence) capabilities on devices powered by OpenSTLinux. This robust tool not only offers a comprehensive display of all available AI applications supported for each board but also excels in identifying the optimal AI application performance for specific hardware. By leveraging the X-LINUX-AI Application, users can achieve superior accuracies and maximize the potential of their AI endeavors.
2. How to install X-LINUX-AI Application[edit source]
After having configured the AI OpenSTLinux package you can install the X-LINUX-AI components.
x-linux-ai --install x-linux-ai-application
3. How to use X-LINUX-AI Application:[edit source]
Usage: x-linux-ai-application -[option] -r <use-case> --model-type <model-type> --language <language> -l --list : list all the available applications -r --run <str> : run application with a specific use case --model-type <str> : run application with a specific model type --language <str> : run application with a specific program language -h --help : Show this help
3.1. Usage Example[edit source]
- The following command can be used to display a list of all the available AI use cases:
x-linux-ai-application -l
root@stm32mp25-revab:~# x-linux-ai-application -l [installed] object-detection [not installed] image-classification [not installed] face-recognition [not installed] semantic-segmentation [not installed] pose-estimation
- For running x-linux-ai-application, refer to the command provided below:
x-linux-ai-application -r <use-case>
root@stm32mp25-revab:~# x-linux-ai-application -r object-detection Running ... Application: tflite-object-detection-python File path: /usr/local/demo-ai/object-detection/tflite/launch_python_object_detection.sh machine used = stm32mp257 user : weston display resolution is : 1024 x 600 Vx delegate: allowed_cache_mode set to 1. Vx delegate: device num set to 0. Vx delegate: allowed_builtin_code set to 0. Vx delegate: error_during_init set to 0. Vx delegate: error_during_prepare set to 0. Vx delegate: error_during_invoke set to 0. Loading external delegate from /usr/lib/libvx_delegate.so.2 number of threads used in tflite interpreter : 2 camera preview mode activate check if a CSI or USB camera is connected /home/weston dcmipp found /home/weston DCMIPP_SENSOR=imx335 main_postproc=/dev/v4l-subdev3 Mediacontroller graph: V4L_DEVICE=video1 V4L2_CAPS=video/x-raw, format=RGB16, width=640, height=480 DCMIPP_SENSOR=imx335 MAIN_POSTPROC=/dev/v4l-subdev3
- The following command can be used to run an application with a specific model type:
x-linux-ai-application -r <use-case> --model-type <model-type>
root@stm32mp25-revab:~# x-linux-ai-application -r object-detection --model-type onnx Running ... Application: onnx-object-detection-python File path: /usr/local/demo-ai/object-detection/onnx/launch_python_object_detection.sh machine used = stm32mp257 user : weston display resolution is : 1024 x 600 NN model used : /usr/local/demo-ai/object-detection/models/coco_ssd_mobilenet/coco_ssd_mobilenet.onnx Number threads used : 2 input shape [1, 300, 300, 3] H,W,C 300 300 3 camera preview mode activate check if a CSI or USB camera is connected /home/weston dcmipp found /home/weston DCMIPP_SENSOR=imx335 main_postproc=/dev/v4l-subdev3 Mediacontroller graph: V4L_DEVICE=video1 V4L2_CAPS=video/x-raw, format=RGB16, width=640, height=480 DCMIPP_SENSOR=imx335 MAIN_POSTPROC=/dev/v4l-subdev3
- x-linux-ai-application offers also the possibility to run an application with a specific program language :
x-linux-ai-application -r <use-case> --language <program language>
root@stm32mp25-revab:~# x-linux-ai-application -r object-detection --language cpp Running ... Application: tflite-object-detection-cpp File path: /usr/local/demo-ai/object-detection/tflite/launch_bin_object_detection.sh machine used = stm32mp257 user : weston model file set to: /usr/local/demo-ai/object-detection/models/coco_ssd_mobilenet/coco_ssd_mobilenet.tflite label file set to: /usr/local/demo-ai/object-detection/models/coco_ssd_mobilenet/labels_coco_ssd_mobilenet.txt camera framerate set to: 30 camera frame width set to: 640 camera frame heightset to: 480 Inference launched on NPU with the delagate :/usr/lib/libvx_delegate.so.2 2 cpu core(s) available EdgeTPU acceleration: not used Delegate acceleration: used Loaded model /usr/local/demo-ai/object-detection/models/coco_ssd_mobilenet/coco_ssd_mobilenet.tflite Vx delegate: allowed_cache_mode set to 0. Vx delegate: device num set to 0. Vx delegate: allowed_builtin_code set to 0. Vx delegate: error_during_init set to 0. Vx delegate: error_during_prepare set to 0. Vx delegate: error_during_invoke set to 0. WARNING: Fallback unsupported op 32 to TfLite check if a CSI or USB camera is connected /home/weston dcmipp found display resolution is : 1024 x 600 Display config <= 600p video source used : /dev/ camera pipeline configuration : ,framerate=30/1