Difference between revisions of "AIMLinux/AddOn/Edge AI"

From ESS-WIKI
Jump to: navigation, search
Line 15: Line 15:
 
0. Before we start for FaceView, please make sure [http://ess-wiki.advantech.com.tw/view/Ubuntu_L4T_User_Guide#Install_SDK_Components SDK components] are installed well on your TX2 device.
 
0. Before we start for FaceView, please make sure [http://ess-wiki.advantech.com.tw/view/Ubuntu_L4T_User_Guide#Install_SDK_Components SDK components] are installed well on your TX2 device.
  
1. Get the program file by contact with Advantech, e.g.''FaceView_1.0.2.0522_aarch64.zip''
+
1. Get the program file by contact with Advantech, e.g. ''FaceView_1.0.2.0522_aarch64.zip''
  
 
2. Put the ZIP file into your device and unzip it.
 
2. Put the ZIP file into your device and unzip it.
Line 60: Line 60:
 
*Vivotek_IB9360H
 
*Vivotek_IB9360H
  
To set up IP camera for FaceView, we have to route RTSP streaming to video device.
+
To configure IP camera for FaceView, we have to route RTSP streaming to video device.
  
 
1. Connect IP camera with TX2 device via Ethernet cable.
 
1. Connect IP camera with TX2 device via Ethernet cable.
Line 75: Line 75:
 
  $ export RTSP_PATH="rtsp://viewer:inventec2017@169.254.6.42:5554/live.sdp"
 
  $ export RTSP_PATH="rtsp://viewer:inventec2017@169.254.6.42:5554/live.sdp"
 
  $ gst-launch-1.0 rtspsrc location="$RTSP_PATH" latency=300 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! tee ! v4l2sink device=/dev/video0
 
  $ gst-launch-1.0 rtspsrc location="$RTSP_PATH" latency=300 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! tee ! v4l2sink device=/dev/video0
 
5. You can verify with this command.
 
 
$ gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! decodebin ! videoconvert ! xvimagesink
 
  
 
==== <span style="color:#0070c0">Run Application</span> ====
 
==== <span style="color:#0070c0">Run Application</span> ====
Line 98: Line 94:
  
 
==== <span style="color:#0070c0">Set Up Build Environment</span> ====
 
==== <span style="color:#0070c0">Set Up Build Environment</span> ====
 +
 +
To develop QT application with FaceMe SDK, you have to install the packages listed below.
 +
 +
1. Install FaceMe SDK, e.g.''FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run''
 +
 +
$ chmod +x FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run
 +
$ sudo ./FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run
 +
...
 +
What path do you want to install? (Press ENTER to use default)[/home/advrisc]
 +
Which detection models do you want to install? ML, and (Press ENTER to use default, DNN DNN-X)[DNN DNN-X]
 +
Which extraction models do you want to install? (Press ENTER to use default, H1 H2 H3 VH UH UH3)[H1 H3 VH UH3]
 +
Do you want to install Demo System? (Press ENTER to use default, yes(y)/no(n))[yes]
 +
Do you want to install Sample code? (Press ENTER to use default, yes(y)/no(n))[yes]
 +
Install SDK Path: /home/advrisc/FaceMeSDK
 +
Install Detection Model: DNN DNN-X
 +
Install Extraction Model: H1 H3 VH UH3
 +
Install GPU support: no
 +
Install DemoSystem: yes
 +
Install Sample Code: yes
 +
Are you sure? (Press ENTER to use default, yes(y)/no(n))[yes]
 +
 +
2. Install pre-built Qt 5.14.2 binaries
 +
 +
$ tar zxvf Qt-5.14.2-Ubuntu18.04-ARM64.tar.gz
 +
$ cd Qt-5.14.2-U18.04-ARM64
 +
$ sudo cp -a * /
 +
 +
$ sudo vim ~/.profile
 +
PATH="/usr/local/Qt-5.14.2/bin:$PATH"
 +
$ source ~/.profile
 +
 +
3. Install QT creator
 +
 +
$ sudo apt-get install qtcreator
 +
 +
4. Install pre-built OpenCV 3.4.2 with CUDA & Jpeg1.5.3 support
 +
 +
$ tar zxvf OpenCV-3.4.2-aarch64-U18.04-JPEG1.5.3.tar.gz
 +
$ cd OpenCV-3.4.2-aarch64
 +
$ sudo cp -a * /usr/local/
  
 
== <span style="color:#0070c0">Traffic Analysis</span> ==
 
== <span style="color:#0070c0">Traffic Analysis</span> ==

Revision as of 08:16, 22 May 2020

Applications

Face Recognition

FaceView

Advantech FaceView application powered by CyberLink's FaceMe®, an industry-leading facial recognition engine, Advantech’s FaceView application provides precise and scalable real-time facial recognition for various AIoT applications in the retail, hospitality, and public safety fields.

Supported Platforms

  • nVidia TX2: EPC-R7000

Installation

0. Before we start for FaceView, please make sure SDK components are installed well on your TX2 device.

1. Get the program file by contact with Advantech, e.g. FaceView_1.0.2.0522_aarch64.zip

2. Put the ZIP file into your device and unzip it.

$ unzip FaceView_1.0.2.0522_aarch64.zip
Archive: FaceView_1.0.2.0522_aarch64.zip
  inflating: FaceView_1.0.2.0522_aarch64.deb
  inflating: install_faceview_dep.sh

3. Run the script to install dependency packages.

$ chmod +x install_faceview_dep.sh
$ ./install_faceview_dep.sh

4. To install FaceView DEB, you can type the commands, or double-click DEB file.

$ sudo dpkg -i FaceView_1.0.2.0522_aarch64.deb

-OR-

FaceView Install

5. Once it's done, you can find the FaceView application in /usr/local/FaceView/ folder.

Setup Camera

We support two kinds of camera on EPC-R7000. One is USB webcam and the other is IP camera.

[USB Webcam]

It's easy to setup webcam by connecting USB with TX2 device.

The two camera products below are verified, but it's OK to use other products which support 1920x1080 or 1280x720 resolution.

  • Microsoft LifeCam HD-3000
  • Logitech BRIO V-U0040

[IP Camera]

EPC-R7000 supports PoE function, so you can run FaceView with IP camera for more flexible camera configurations.

The IP camera below is verified. We will take it as an example to set up.

  • Vivotek_IB9360H

To configure IP camera for FaceView, we have to route RTSP streaming to video device.

1. Connect IP camera with TX2 device via Ethernet cable.

2. Assign corresponding IP address for the PoE port, e.g. 169.254.111.1/16.

3. Install V4L2Loopback utility & drivers.

$ sudo apt-get install v4l2loopback-utils

4. Route RTSP streaming to video device.

$ sudo modprobe v4l2loopback
$ export RTSP_PATH="rtsp://viewer:inventec2017@169.254.6.42:5554/live.sdp"
$ gst-launch-1.0 rtspsrc location="$RTSP_PATH" latency=300 ! rtph264depay ! h264parse ! omxh264dec ! videoconvert ! tee ! v4l2sink device=/dev/video0

Run Application

To execute FaceView application, navigate to /usr/local/FaceView/ folder and double-click FaceView icon, or run the application by command mode.

$ cd /usr/local/FaceView/
$ ./FaceView

Then, you will be asked to input license key. Note: Please make sure your network connection is OK to activate the license successfully.

Input License

If the key is valid, you are able to see camera preview screen from the application.

FaceView Screen

For details of operations, please refer to the FaceView user guide.

Set Up Build Environment

To develop QT application with FaceMe SDK, you have to install the packages listed below.

1. Install FaceMe SDK, e.g.FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run

$ chmod +x FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run
$ sudo ./FaceMe_SDK_Ubuntu18_ARM64_3.18.0.run
...
What path do you want to install? (Press ENTER to use default)[/home/advrisc]
Which detection models do you want to install? ML, and (Press ENTER to use default, DNN DNN-X)[DNN DNN-X]
Which extraction models do you want to install? (Press ENTER to use default, H1 H2 H3 VH UH UH3)[H1 H3 VH UH3]
Do you want to install Demo System? (Press ENTER to use default, yes(y)/no(n))[yes]
Do you want to install Sample code? (Press ENTER to use default, yes(y)/no(n))[yes]
Install SDK Path: /home/advrisc/FaceMeSDK
Install Detection Model: DNN DNN-X
Install Extraction Model: H1 H3 VH UH3
Install GPU support: no
Install DemoSystem: yes
Install Sample Code: yes
Are you sure? (Press ENTER to use default, yes(y)/no(n))[yes]

2. Install pre-built Qt 5.14.2 binaries

$ tar zxvf Qt-5.14.2-Ubuntu18.04-ARM64.tar.gz
$ cd Qt-5.14.2-U18.04-ARM64
$ sudo cp -a * /

$ sudo vim ~/.profile
PATH="/usr/local/Qt-5.14.2/bin:$PATH"
$ source ~/.profile

3. Install QT creator

$ sudo apt-get install qtcreator

4. Install pre-built OpenCV 3.4.2 with CUDA & Jpeg1.5.3 support

$ tar zxvf OpenCV-3.4.2-aarch64-U18.04-JPEG1.5.3.tar.gz
$ cd OpenCV-3.4.2-aarch64
$ sudo cp -a * /usr/local/

Traffic Analysis

IVS

Supported Platforms

  • nVidia TX2: EPC-R7000

Run Application

Inference Engines

Platform

nVidia TX2

NXP i.MX series

eIQ