Difference between revisions of "I.MX8 Deep Learning Reference Designs/Getting Started/Evaluating the Project"

From RidgeRun Developer Connection
Jump to: navigation, search
(RTSP Protocol)
m
 
(11 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
{{I.MX8 Deep Learning Reference Designs/Head|previous=Getting_Started/Environment Setup|next=Getting_Started/Purchasing a License}}
 
{{I.MX8 Deep Learning Reference Designs/Head|previous=Getting_Started/Environment Setup|next=Getting_Started/Purchasing a License}}
 
</noinclude>
 
</noinclude>
 +
 +
{{DISPLAYTITLE:I.MX8 Deep Learning Reference Designs - Evaluating the Project |noerror}}
  
 
== Project Installation and Execution ==
 
== Project Installation and Execution ==
Line 7: Line 9:
 
=== Pre-trained Models ===
 
=== Pre-trained Models ===
  
The inference process performed in this project relies on the use of People Detection in a Restricted Zone. The [https://drive.google.com/drive/u/0/folders/1-cP_vL9-Q39FfkowXc9SOcsTPsJ9p4Dw model] (TinyYolo) included in this project is used together with the [https://developer.ridgerun.com/wiki/index.php/GstInference/Introduction 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 [https://developer.ridgerun.com/wiki/index.php/I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector#DeepStream_Models Wiki].
+
The inference process performed in this project relies on the use of People Detection in a Restricted Zone. The [https://drive.google.com/drive/u/0/folders/1-cP_vL9-Q39FfkowXc9SOcsTPsJ9p4Dw model] (TinyYolo) included in this project is used together with the [[GstInference#Introduction | 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 [[I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector | Wiki on Restricted Zone Detector UseCase]].
  
 
=== Run the application ===
 
=== Run the application ===
  
This project was designed to be built using a custom [https://www.yoctoproject.org/ 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.   
+
This project was designed to be built using a custom [https://www.yoctoproject.org/ 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 [https://developer.ridgerun.com/wiki/index.php/I.MX8_Deep_Learning_Reference_Designs/Getting_Started/Environment_Setup Environment Setup] section of this wiki.
+
If you have not performed the process of creating a system image, we encourage you to follow the steps in the [[I.MX8_Deep_Learning_Reference_Designs/Getting_Started/Environment_Setup | 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 [https://developer.ridgerun.com/wiki/index.php/I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector#RZD_Config Wiki], you can check more information about the rzd.yaml and the rest of the files located in the config files directory.
+
'''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 [[I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector#RZD_Config | Wiki]], you can check more information about the rzd.yaml and the rest of the files located in the config files directory.
  
 
=== Web Dashboard ===
 
=== Web Dashboard ===
Line 27: Line 29:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
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 <span style="color: blue"> /dashboard </span>. 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 [https://developer.ridgerun.com/wiki/index.php/I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector this Wiki].
+
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 <span style="color: blue"> /dashboard </span>. 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 [[I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector | this Wiki]].
  
 
To run the web dashboard, open another terminal and navigate to the following path:
 
To run the web dashboard, open another terminal and navigate to the following path:
Line 45: Line 47:
 
=== RTSP Protocol ===
 
=== 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 [https://developer.ridgerun.com/wiki/index.php/I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector rzd application], that simulate cameras in a parking lot. The videos can be downloaded at the following address: [https://www.pexels.com/video/rainy-weather-video-854204/ RZD Test Videos]. Inside the drive folder.  
+
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 [[I.MX8_Deep_Learning_Reference_Designs/Reference_Designs/Restricted_Zone_Detector | rzd application]], that simulate cameras in a parking lot. The videos can be downloaded at the following address: [https://www.pexels.com/video/rainy-weather-video-854204/ RZD Test Videos]. Inside the drive folder.  
  
 
For the execution of videos using the RTSP protocol, you can use the methods provided by the [https://www.videolan.org/vlc/download-ubuntu.html 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:
 
For the execution of videos using the RTSP protocol, you can use the methods provided by the [https://www.videolan.org/vlc/download-ubuntu.html 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:
Line 53: Line 55:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
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 <span style="color: blue"> rzd.yaml </span> configuration file:
+
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 <span style="color: blue"> '''rzd.yaml''' </span> configuration file:
  
 
<syntaxhighlight lang="yaml">
 
<syntaxhighlight lang="yaml">
Line 69: Line 71:
 
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:
 
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 [https://developer.ridgerun.com/wiki/index.php/GStreamer_Daemon Gstreamer Daemon] instance in a new terminal:
+
1. Start a [[GStreamer_Daemon | Gstreamer Daemon]] instance in a new terminal:
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
$ gstd
 
$ gstd

Latest revision as of 05:50, 6 October 2022


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