NXP eIQ

From ESS-WIKI
Jump to: navigation, search

NXP i.MX series

The i.MX 8M Plus family focuses on neural processing unit (NPU) and vision system, advance multimedia, andindustrial automation with high reliability.

  • The Neural Processing Unit (NPU) of i.MX 8M Plus operating at up to 2.3 TOPS

NXP Demo Experience (Yocto 3.3 ~ latest)

  • Preinstalled on NXP-provided demo Linux images
  • imx-image-full image must be used
  • Yocto 3.3 (5.10.52_2.1.0 ) ~ Yocto 4.2 (6.1.1_1.0.0)
  • Need to connect the internet

Start the demo launcher by clicking NXP Logo is displayed on the top left-hand corner of the screen

2023-09-27 155355.png

2023-09-27 155552.png

Machine Learning Demos
  • NNStreamer demos
    • Object classification
    • Object detection
    • Pose detection
    • Brand detection
    • ML gateway

 2023-09-27 155836.png  

  • OpenCV demos
    • Face recognition
    • Selfie segmentation

 2023-09-27 162615.png

NNStreamer Demo: Object Detection

Click the "Object Detection " and Launch Demo

111111111333.png  

Set some parameters:

22222222222.png  

  • Source: Select the camera to use or to use the example video
  • Backend: Select whether to use the NPU (if available) or CPU for inferences.
  • Height: Select the input height of the video if using a camera.
  • Width: Select the input width of the video if using a camera.
  • Label Color: Select the color of the overlay labels.

The result of NPU object detection:

3333333333.png  

NXP Demo Experience - Text User Interface(TUI)

Demos can also be launched from the command line through log-in into the board remotely or using the onboard serial debug console. Keep in mind that most demos still require a display to run successfully.

To start the text user interface, type the following command into the command line.

$ demoexperience tui

2023-09-27 170604.png  

The interface can be navigated using the following keyboard inputs:

  • Up and down arrow keys: Select a demo from the list on the left
  • Enter key: Runs the selected demo
  • Q key or Ctrl+C keys: Quit the interface
  • H key: Opens the help menu

Demos can be closed by closing the demo onscreen or pressing the "Ctrl" and "C" keys at the same time.

 

PyeIQ - A Python Framework for eIQ on i.MX Processors (Yocto 3.0)

PyeIQ is written on top of eIQ™ ML Software Development Environment and provides a set of Python classes

allowing the user to run Machine Learning applications in a simplified and efficiently way without spending time on

cross-compilations, deployments or reading extensive guides.

Installation
  • Method 1: Use pip3 tool to install the package located at PyPI repository:
$ pip3 install pyeiq
  • Method 2: Get the latest tarball  Download files  and copy it to the board:
$ pip3 install <tarball>

pyeiq tarball:

For the 5.4.70_2.3.0 BSP:

  • Install the v3.0.0 version and it run on NPU

For the 5.10.72_2.2.0 ~ 6.1.22_2.0.0​ BSP (Suggest to use the demo experience)

  • Install the v3.1.0 version, but it run on CPU

Download PyeIQ Cache Data

$ tar -zxvf eiq-cache-data_3.0.0.tar.gz

2023-09-28 092741.png  

How to Run Samples
  •  Start the manager tool:
$ pyeiq
  • The above command returns the PyeIQ manager tool options:
Manager Tool Command Description Example
pyeiq --list-apps List the available applications.  
pyeiq --list-demos List the available demos.  
pyeiq --run <app_name/demo_name> Run the application or demo. # pyeiq --run object_detection_tflite
pyeiq --info <app_name/demo_name> Application or demo short description and usage.  
pyeiq --clear-cache Clear cached media generated by demos. # pyeiq --info object_detection_tflite
PyeIQ Demos
  • covid19_detection 
  • object_classification_tflite
  • object_detection_tflite

Demos Example - Running Object Detection

Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos. Well-researched domains of object detection include face detection and pedestrian detection. Object detection has applications in many areas of computer vision, including image retrieval and video surveillance.

  • Run the Object Detection Default Image demo using the following line:
$ pyeiq --run object_detection_tflite

           *  This runs inference on a default image:

2023-09-27 172321.png  

  • Run the Object Detection Custom Image demo using the following line:
$ pyeiq --run object_detection_tflite --image=/path_to_the_image
  • Run the Object Detection Video File using the following line:
$ pyeiq --run object_detection_tflite --video_src=/path_to_the_video
  • Run the Object Detection Video Camera or Webcam using the following line:
$ pyeiq --run object_detection_tflite --video_src=/dev/video<index>

 

eIQ Toolkit

The eIQ Toolkit is a machine-learning software development environment that enables the use of ML algorithms on
NXP microcontrollers, microprocessors, and SoCs.
The eIQ Toolkit is for those interested in building machine learning solutions on embedded devices. A background in
machine learning, especially in supervised classification, is helpful to understand the entire pipeline. However, if the
user does not have any background in the areas mentioned above, the eIQ Toolkit is designed to assist the user.
The eIQ Toolkit consists of the following three key components:

  • eIQ Portal
  • eIQ Model Tool
  • eIQ Command-line Tools

  2023-09-27 174948.png  

Download link: https://www.nxp.com/design/software/eiq-ml-development-environment/eiq-toolkit-for-end-to-end-model-development-and-deployment:EIQ-TOOLKIT\

There are two approaches available with the eIQ Toolkit, based on what the user provides and what the expectations are.

  • Bring Your Own Data (BYOD) – the users bring image data, use the eIQ Toolkit to develop their own model, and deploy it on the target.
  • Bring Your Own Model (BYOM) – the users bring a pretrained model and use the eIQ Toolkit for optimization, deployment, or profiling.

  2023-09-27 175257.png

 

References

i.MX Machine Learning User's Guide: https://www.nxp.com/docs/en/user-guide/IMX-MACHINE-LEARNING-UG.pdf

NXP Demo Experience User's Guide:  https://www.nxp.com/docs/en/user-guide/DEXPUG.pdf

pyeiq: https://community.nxp.com/t5/Blogs/PyeIQ-3-x-Release-User-Guide/ba-p/1305998

eIQ Toolkit User Guide: https://www.nxp.com/docs/en/user-guide/EIQTKUG-1.8.0.pdf

TP-EVB_eIQ_presentation.pdf: https://www.nxp.com/docs/en/training-reference-material/TP-EVB_eIQ_presentation.pdf