I.MX8 Deep Learning Reference Designs - Evaluating the Project

From RidgeRun Developer Connection
Jump to: navigation, search


NXP Partner Program Registered Vertical.jpg NXP Partner Program Horizontal.jpg


Previous: Getting_Started/Environment Setup Index Next: Getting_Started/Purchasing a License






Project Installation and Execution

Pre-trained Models

The inference process performed in this project relies on the use of People Detection in a Restricted Zone. The model (TinyYolo) included in this project is used together with the GstInference interface based on a Tensorflow Lite backend. If you want more information about the gstinference pipeline configuration and the models used, you can read the following Wiki on Restricted Zone Detector UseCase.

Run the application

This project was designed to be built using a custom Yocto meta layer. Thanks to this feature, it is not necessary to install any Python dependencies or external libraries directly from the iMX8 board, since they are all installed and set up in the custom image which should be used to flash the board.

If you have not performed the process of creating a system image, we encourage you to follow the steps in the Environment Setup section of this wiki.

Important Note: Before you test the project, we strongly recommend that you check the config parameters located in the /usr/share/config_files/rzd.yaml file of the iMX8 board, since you must configure this file with the required parameters to run the app successfully. In the following Wiki, you can check more information about the rzd.yaml and the rest of the files located in the config files directory.

Web Dashboard

By default, the project has a functionality of a Web Dashboard, where you can see in real-time the logs of the information generated. The configuration of this functionality is done through the actions section of the rzd.yaml config file. For instance, through the "url" parameter you can indicate the IP address and the port where the API that hosts the web page will be launched:

actions:
  - name: "dashboard"
    url:  "http://127.0.0.1:4200/dashboard"

In the example above, the web dashboard will be listening on the local address of 127.0.0.1 , and port 4200. You can change those two values, as long as you respect the API endpoint called /dashboard . Make sure there are no firewall problems on the indicated IP address and port so that the communication can take place without any problem. If you want to know more about this functionality and other actions included in this reference design, you can consult this Wiki.

To run the web dashboard, open another terminal and navigate to the following path:

$ cd /usr/lib/python3.9/site-packages/src/rzd/dashboard/

And finally, execute the following command:

$ python3 web_app.py

Important Note: Dashboard execution does not need to be done within the imx8 board, you can use another computer as the dashboard host, as long as you set the correct IP address and port number to establish the respective communication. Also, in case you don't want to use this functionality, you can simply remove it from the action parameters of the rzd.yaml configuration file.

RTSP Protocol

This application uses the RTSP protocol to receive the streaming information data coming from the cameras of the system. For testing purposes, we provide some test videos, in the context of the rzd application, that simulate cameras in a parking lot. The videos can be downloaded at the following address: RZD Test Videos. Inside the drive folder.

For the execution of videos using the RTSP protocol, you can use the methods provided by the VLC media player. For example, if you want to start a forever loop broadcast on the IP address x, using the video samples, you can run the following commands on separate terminal instances:

$ cvlc -vvv --no-one-instance --loop people_video_test.mp4 --sout='#gather:rtp{sdp=rtsp://:8554/stream}' --sout-keep --sout-all

You are free to change the values of the IP address and the ports used, as long as you verify that the address where the transmission is made does not have firewall communication problems or something that prevents the system from receiving the transmission signal. Also, verify that the RTSP address used matches the stream's URL parameters in the rzd.yaml configuration file:

streams:
  - id: "ZoneA"
    url: "rtsp://127.0.0.1:8554/stream"
    triggers:
      - "trespassing"

The section shown previously is the one that comes by default in the project. In addition, check that there is a match with the parameter of the sectorA, with respect to the transmissions used, so that the information received makes sense during the project execution.

Code Execution

Once you have already flashed the board with our custom image, set the dashboard feature, and a camera instance to listen to, you can execute the app by running the following commands:

1. Start a Gstreamer Daemon instance in a new terminal:

$ gstd

2. Run the restricted zone detector application command from another terminal:

$ rzd




Previous: Getting_Started/Environment Setup Index Next: Getting_Started/Purchasing a License