PyeIQ v1.0 for BSP 5.4.3_2.0.0 Release

Document created by Diego Dorta Employee on May 6, 2020Last modified by Marco Antonio Franchi on May 19, 2020
Version 12Show Document
  • View in full screen mode
Welcome to PyeIQ
PyeIQ gathers everything needed by itself. It provides a simplified way to run ML applications, which avoids the user spending time on preparing the environment.
PyeIQ VersionRelease DateNotes
tag_v1.0Apr 29, 2020-
tag_v2.0-Planned for June
i.MX BoardBSP ReleaseBuilding Status
8 QM5.4.3_2.0.0passing
8 MPlus5.4.3_2.0.0passing

Getting Started with PyeIQ

1. Easy Installation

  • If you prefer to build the package by yourself go to Appendix Section or follow the README file at the PyeIQ repo.
1.1 Copy the PyeIQ pre-built package attached to the board, and then install it by using pip3 tool:
root@imx8:~# pip3 install eiq-<version>.tar.gz
1.2 Check the installation by starting an interactive shell:
root@imx8:~# python3
 
1.3 Import PyeIQ and see the version:
>>> import eiq
>>> eiq.__version__
The output is the PyeIQ latest version installed in the system.
  • (Optional) Install the following package to show downloading status:
root@imx8:~# pip3 install progressbar

2. Easy Running

All demos and applications are automatically installed in /opt/eiq.
2.1 To run the demos:
root@imx8:~# cd /opt/eiq/demos
root@imx8:~/opt/eiq/demos# python3 <demo_name>.py
2.2 To run the applications:
root@imx8:~# cd /opt/eiq/apps
root@imx8:~/opt/eiq/apps# python3 <app_name>.py

 

2.3 Use help if needed:

root@imx8:~/opt/eiq/demos# python3 <demo_name>.py --help
root@imx8:~/opt/eiq/apps# python3 <app_name>.py --help

3. List of Available Demos and Applications

Demo/App NameDemo/App Typei.MX BoardBSP ReleaseBSP FrameworkInferenceStatusNotes
Label ImageFile BasedQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassing-
Label Image SwitchFile BasedQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassing-
Object DetectionSSD/CameraQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassingNeed better model.
Object Detection OpenCVSSD/CameraQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassingNeed better model.
Object Detection N. GS.SSD/CameraQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPU-Pending issues.
Object Detection Yolov3SSD/FileQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPU-Pending issues.
Object Detection Yolov3SSD/CameraQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPU-Pending issues.
Fire DetectionFile BasedQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassing-
Fire DetectionCameraQM, MPlus5.4.3_2.0.0TensorFlow Lite 2.1.0GPU, NPUpassing-
Fire DetectionCamera-5.4.3_2.0.0PyArmNN 19.08--Requires 19.11
Coral PosenetCamera-----Ongoing
NEO DLRCamera-----Ongoing

4. Examples

4.1 Fire Detection Image

4.1.1 Non-fire

Running Fire Detect Image:
root@imx8:~/opt/eiq/demos# python3 fire_detect_image --image=house.jpg
    Output:
INFO: Created TensorFlow Lite delegate for NNAPI.                                                                       
Applied NNAPI delegate.                                                                                                 
Inference time: 0:00:00.264853                                                                                          
Non-Fire  

4.1.2 Fire

Running Fire Detect Image:
root@imx8:~/opt/eiq/demos# python3 fire_detect_image.py --image=burning-house.jpg

Output:
INFO: Created TensorFlow Lite delegate for NNAPI.                                                                       
Applied NNAPI delegate.                                                                                                 
Inference time: 0:00:00.193055                                                                                          
Fire   

4.2 Fire Detection Camera

Running Fire Detect Camera:
root@imx8:~/opt/eiq/demos# python3 fire_detect_camera.py
Output:
PyeIQ also supports training for Fire Detection demo, please refer to PyeIQ - Training and Conversion Support (Keras/TensorFlow Lite) .

4.3 Label Image Switch

Running Switch Label Image:
root@imx8:~/opt/eiq/apps# python3 switch-label.py
Output:

Cores Comparison (CPU, GPU and NPU)

  • Check the following graphical plot for Switch Label Image demo:

 

 

  • Check the following graphical plot for the other demos:

We are currently working to reduce the inference time on Fire Detection demos.

Appendix Section

The procedures described in this document target a GNU/Linux Distribution Ubuntu 18.04.

1. Software Requirements

1.1 Install the following packages in the GNU/Linux system:
~# apt install python3 python3-pip
1.2 Then, use pip3 tool to install the virtualenv tool:
~$ pip3 install virtualenv

2. Building the PyeIQ Package

2.1 Clone the repository:
~$ git clone https://source.codeaurora.org/external/imxsupport/pyeiq/
~/pyeiq$ git checkout tag_v1.0
2.2 Use virtualenv tool to create an isolated Python environment:
~/pyeiq$ virtualenv env
~/pyeiq$ source env/bin/activate
2.3 Generate the PyeIQ package:
(env) ~/pyeiq$ python3 setup.py sdist bdist_wheel

 

2.4 Copy the package to the board:
(env) ~/pyeiq$ scp dist/eiq-<version>.tar.gz root@<board_IP>:~
2.5 To deactivate the virtual environment:
(env) ~/pyeiq$ deactivate

Contact

Feel free to contact us about any issue/bug you might have it. Your feedback is very welcome so we can improve the next version

1 person found this helpful

Attachments

Outcomes