Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 656aabb

Browse files
committed
SVET Linux sample appliction 2020 R3 release
Dependency: MediaSDK 20.3 and OpenVINO 2021.1 New features on R3: Support CPU inference by option “-infer::device GPU”. Support shared inference network instance between sessions Support setting decoding output to RGBP by option “-dc::rgbp” Support 2 video decoder outputs from SFC and VPP in different sizes and color format Support more detection networks by specify XML files Signed-off-by: Elaine Wang <[email protected]>
1 parent 6a6e584 commit 656aabb

36 files changed

+1362
-323
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,33 +27,33 @@ See [FAQ](./doc/FAQ.md)
2727
* [Known limitations](#know-limitations)
2828

2929
# License
30-
The sample application is licensed under MIT license. See [LICENSE](./LICENSE) for details.
30+
The sample application is licensed under MIT license. See [LICENSE](./video_e2e_sample/LICENSE) for details.
3131

3232
# How to contribute
3333
See [CONTRIBUTING](./doc/CONTRIBUTING.md) for details. Thank you!
3434

3535
# Documentation
36-
See [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf)
36+
See [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.3.0.pdf)
3737

3838
# System requirements
3939

4040
**Operating System:**
4141
* Ubuntu 18.04.02
4242

4343
**Software:**
44-
* [MediaSDK 20.1.1](https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-20.1.1)
45-
* [OpenVINO™ 2020.3](https://software.intel.com/en-us/openvino-toolkit)
44+
* [MediaSDK 20.3.0](https://github.com/Intel-Media-SDK/MediaSDK/releases/tag/intel-mediasdk-20.3.0)
45+
* [OpenVINO™ 2021.1](https://software.intel.com/en-us/openvino-toolkit)
4646

4747
**Hardware:**
48-
* Intel® platforms supported by the MediaSDK 20.1.1 and OpenVINO 2020.3.
48+
* Intel® platforms supported by the MediaSDK 20.3.0 and OpenVINO 2021.1.
4949
* For Media SDK, the major platform dependency comes from the back-end media driver. https://github.com/intel/media-driver
5050
* For OpenVINO™, see details from here: https://software.intel.com/en-us/openvino-toolkit/documentation/system-requirements
5151

5252
# How to build
5353

5454
Run build_and_install.sh to install dependent software packages and build sample application video_e2e_sample.
5555

56-
Please refer to ”Installation Guide“ in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf) for details.
56+
Please refer to ”Installation Guide“ in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.3.0.pdf) for details.
5757

5858
## Build steps
5959

@@ -68,10 +68,10 @@ cd cva_sample
6868
```
6969
This script will install the dependent software packages by running command "apt install". So it will ask for sudo password. Then it will download libva, libva-util, media-driver and MediaSDK source code and install these libraries. It might take 10 to 20 minutes depending on the network bandwidth.
7070

71-
After the script finishing, the sample application video_e2e_sample can be found under ./bin. Please refer to "Run sample application" in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.2.0.pdf) for details.
71+
After the script finishing, the sample application video_e2e_sample can be found under ./bin. Please refer to "Run sample application" in [user guide](./doc/concurrent_video_analytic_sample_application_user_guide_2020.3.0.pdf) for details.
7272

7373
# Known limitations
7474

75-
The sample application has been validated on Intel® platforms Skylake(i7-6770HQ), Coffee Lake(i7-8559U i7-8700) and Whiskey Lake(i7-8665UE).
75+
The sample application has been validated on Intel® platforms Skylake(i7-6770HQ), Coffee Lake(i7-8559U i7-8700), Whiskey Lake(i7-8665UE) and Tiger Lake U(i7-1185G7E, i5-1135G7E).
7676

7777

build_and_install.sh

+84-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
#!/bin/bash
22

33
root_path=$PWD
4+
#download_method="git"
5+
download_method="wget"
46

57
if [[ ! -d "${INTEL_OPENVINO_DIR}" ]];
68
then echo "Please make sure openvino has been installed and enviroment variables has been set by "
79
echo "source intel/openvino/bin/setupvars.sh"
810
exit -1;
911
fi
1012

11-
./msdk_pre_install.py
13+
sudo apt install python
14+
15+
if [[ $download_method == "git" ]]
16+
then
17+
python msdk_pre_install_internal.py | tee svet_download.log
18+
else
19+
python msdk_pre_install.py | tee svet_download.log
20+
fi
1221

1322
git_projects="MediaSDK media-driver libva"
1423
for i in $git_projects;
@@ -21,6 +30,33 @@ do
2130
fi
2231
done
2332

33+
#check md5sum if wget is used to download source code packages
34+
35+
if [[ $download_method == "wget" ]]
36+
then
37+
echo "Checking the md5sum of downloaded packages"
38+
declare -A media_packages_md5sum
39+
media_packages_md5sum[intel-gmmlib-20.3.2.tar.gz]=583d9fbef52d880238629f2ced50a9be
40+
media_packages_md5sum[intel-media-20.3.0.tar.gz]=9c9219c09447567254aec00ade5dd3b8
41+
media_packages_md5sum[intel-mediasdk-20.3.0.tar.gz]=1fd2cb03d15b3c308e6a9bd1735d2845
42+
media_packages_md5sum[libva.tar.gz]=fdc00aedad4a51e058403f5f24d9abac
43+
media_packages_md5sum[libva-utils.tar.gz]=a22479f85f7693536c5756ad46192b32
44+
45+
for c in ${!media_packages_md5sum[@]}; do
46+
md5_res=`md5sum $c`
47+
if [[ ${media_packages_md5sum[$c]} == ${md5_res%% *} ]]
48+
then
49+
echo "$c" "${media_packages_md5sum[$c]}" correct
50+
else
51+
echo "$c" "md5sum is wrong " ${md5_res%% *} vs ${media_packages_md5sum[$c]}
52+
echo "Pleaes remove libva/media-driver/MediaSDK re-run this script"
53+
echo "If you still see md5sum not match, please refer to msdk_pre_install.py and download, uncomparess the package manually"
54+
echo "Or you can modify line 5 in this scirpt and change the download_method to \"git\". Then re-run this script."
55+
exit
56+
fi
57+
done
58+
fi
59+
2460
cd "MediaSDK"
2561
patch -N --no-backup-if-mismatch -p1 < ../patches/0001-MSDK-Enable-AVC-decode-SFC-RGB4.patch
2662
patch -N --no-backup-if-mismatch -p1 < ../patches/0002-sample_common-Add-support-to-multiple-displays.patch
@@ -30,15 +66,21 @@ if [ $? != 0 ]; then
3066
fi
3167

3268
cd ../
33-
cp -rf video_e2e_sample MediaSDK/samples/
3469

35-
./msdk_pre_install.py -b cfl
70+
if [[ $download_method == "git" ]]
71+
then
72+
python msdk_pre_install_internal.py -b cfl| tee svet_build.log
73+
else
74+
python msdk_pre_install.py -b cfl | tee svet_build.log
75+
fi
3676

37-
if [[ -f MediaSDK/build/__bin/release/video_e2e_sample ]];
77+
#video_e2e_sample depends on libsample_common.a
78+
if [[ -f MediaSDK/build/__lib/release/libsample_common.a ]];
3879
then
3980
rm -f bin
4081
ln -s MediaSDK/build/__bin/release/ bin
4182

83+
4284
va_env_set=`grep "LIBVA_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri" ~/.bashrc -c`
4385

4486
if (( va_env_set == 0 ))
@@ -56,10 +98,17 @@ then
5698

5799
fi
58100

59-
if [[ $LD_LIBRARY_PATH != *"/opt/intel/mediasdk/lib"* ]]
101+
if [[ -d "/opt/intel/mediasdk/lib64" ]]
102+
then
103+
echo "A old MediaSDK version is found under folder /opt/intel/mediasdk/lib64"
104+
echo "Rename /opt/intel/mediasdk/lib64 as /opt/intel/mediasdk/oldlib64"
105+
mv /opt/intel/mediasdk/lib64 /opt/intel/mediasdk/oldlib64
106+
fi
107+
108+
if [[ $LD_LIBRARY_PATH != *"/opt/intel/mediasdk/lib/"* ]]
60109
then
61-
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/intel/mediasdk/lib"
62-
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/intel/mediasdk/lib"' >> ~/.bashrc
110+
export LD_LIBRARY_PATH="/opt/intel/mediasdk/lib/:$LD_LIBRARY_PATH"
111+
echo 'export LD_LIBRARY_PATH="/opt/intel/mediasdk/lib/:$LD_LIBRARY_PATH"' >> ~/.bashrc
63112
fi
64113

65114
if [[ -d $cl_cache_dir ]];
@@ -73,8 +122,34 @@ then
73122
echo "mkdir -p ~/cl_cache" >> ~/.bashrc
74123
echo "export cl_cache_dir=~/cl_cache" >> ~/.bashrc
75124
fi
76-
echo "Sample application building has completed!"
77-
echo "Please use ./bin/video_e2e_sample for testing"
125+
126+
#Start to build SVET sample application
127+
#Copy MediaSDK sample headers and libraries that weren't installed by default
128+
sudo mkdir -p /opt/intel/mediasdk/include/sample_common
129+
sudo mkdir -p /opt/intel/mediasdk/include/vpp_plugin
130+
sudo mkdir -p /opt/intel/mediasdk/include/rotate_cpu
131+
sudo cp -rf MediaSDK/samples/sample_common/include/ /opt/intel/mediasdk/include/sample_common/
132+
sudo cp -rf MediaSDK/samples/sample_plugins/vpp_plugin/include/ /opt/intel/mediasdk/include/vpp_plugin/
133+
sudo cp -rf MediaSDK/samples/sample_plugins/rotate_cpu/include/ /opt/intel/mediasdk/include/rotate_cpu/
134+
sudo cp -f MediaSDK/build/__lib/release/libsample_common.a /opt/intel/mediasdk/lib/
135+
sudo cp -f MediaSDK/build/__lib/release/libvpp_plugin.a /opt/intel/mediasdk/lib/
136+
137+
mkdir -p video_e2e_sample/build
138+
cd video_e2e_sample/build
139+
cmake ../ | tee /tmp/svet_build.log
140+
cat /tmp/svet_build.log >> svet_build.log
141+
make -j4 | tee /tmp/svet_build.log
142+
cat /tmp/svet_build.log >> svet_build.log
143+
144+
cd $root_path
145+
if [[ -f bin/video_e2e_sample ]];
146+
then
147+
echo "SVET sample application building has completed!"
148+
echo "Please use ./bin/video_e2e_sample for testing"
149+
else
150+
echo "SVET sample application building failed!"
151+
echo "Please create an IPS with SVET in title on premiersupport.intel.com and upload ./svet_build.log ./svet_download.log to IPS."
152+
fi
78153
fi
79154

80155
#Download openvino models

doc/CONTRIBUTING.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ Steps:
1414

1515
## Requirements
1616

17-
Hardware Requirements: Coffee Lake or Whiskey Lake
18-
Software Requirements: Ubuntu 18.04, MediaSDK 19.4.0 and OpenVINO 2019 R3
17+
Hardware Requirements: Coffee Lake, Sky Lake, Kaby Lake, Whiskey Lake or Tiger Lake
18+
Software Requirements: Ubuntu 18.04, MediaSDK 20.3.0 and OpenVINO 2021.1
1919

2020
## How to test your changes
2121

@@ -24,11 +24,13 @@ Software Requirements: Ubuntu 18.04, MediaSDK 19.4.0 and OpenVINO 2019 R3
2424
```sh
2525
./build_and_install.sh
2626
```
27-
Apply the changes to MediaSDK/samples/video_e2e_sample/. Then build video_e2e_sample:
27+
Apply the changes to video_e2e_sample. Then build video_e2e_sample:
2828
```sh
29-
cp msdk_build.sh MediaSDK
30-
cd MediaSDK
31-
./msdk_build.sh
29+
cd video_e2e_sample
30+
mkdir -p build
31+
cd build
32+
cmake ../
33+
make -j4
3234
```
3335

3436
### 2. Run tests to make sure below tests can run without error

doc/FAQ.md

+4
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ face-detection-retail-0004, human-pose-estimation-0001, vehicle-attributes-recog
4646

4747
## Can I use other OpenVINO version rather than 2020.3 ?
4848
Yes, but you have to modify some code due to interfaces changing. And also you need to download the IR files and copy them to ./model manually. Please refer to script/download_and_copy_models.sh for how to download the IR files.
49+
50+
## When run 4 channel decode plus inference and display on APL, the CPU occupy ratio is very high and fps is low
51+
Please refer to par file par_file/inference/n4_face_detection_rgbp.par. It uses option "-dc::rgbp" that make the SFC outputs RGB4 for display and VPP outputs RGBP for inference input. Then there is no need to use OpenCV for resizing and color conversion which consume much CPU time on APL.
52+
Note, "-dc::rgbp" only works with "-infer::fd". Will support more inference types in the future.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

msdk_build.sh

-5
This file was deleted.

msdk_pre_install.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def fnParseCommandline():
127127

128128
print "Please input the sudo password to proceed\n"
129129
cmd ="sudo apt-get -y install git libssl-dev dh-autoreconf cmake libgl1-mesa-dev libpciaccess-dev build-essential curl imagemagick unzip yasm libjpeg-dev libavcodec-dev libavutil-dev libavformat-dev;"
130-
cmd+="sudo apt-get -y install checkinstall pkg-config"
130+
cmd+="sudo apt-get -y install coreutils checkinstall pkg-config opencl-clhpp-headers opencl-c-headers ocl-icd-opencl-dev"
131131
os.system(cmd)
132132

133133
print ""
@@ -138,38 +138,38 @@ def fnParseCommandline():
138138
# Pull all the source code
139139
print "libva"
140140
if not os.path.exists("%s/libva"%(WORKING_DIR)):
141-
cmd = "cd %s; rm -f libva.tar.gz; wget https://github.com/intel/libva/archive/2.7.1.tar.gz -O libva.tar.gz;"%(WORKING_DIR)
142-
cmd+= "tar zxf libva.tar.gz; mv libva-2.7.1 libva"
141+
cmd = "cd %s; rm -f libva.tar.gz; wget https://github.com/intel/libva/archive/2.9.0.tar.gz -O libva.tar.gz;"%(WORKING_DIR)
142+
cmd+= "tar zxf libva.tar.gz --one-top-level=libva --strip-components 1"
143143
print cmd
144144
os.system(cmd);
145145

146146
print "libva-utils"
147147
if not os.path.exists("%s/libva-utils"%(WORKING_DIR)):
148148
cmd = "cd %s;rm -f libva-utils.tar.gz;"%(WORKING_DIR)
149-
cmd += "wget https://github.com/intel/libva-utils/archive/2.7.1.tar.gz -O libva-utils.tar.gz;"
150-
cmd += "tar zxf libva-utils.tar.gz; mv libva-utils-2.7.1 libva-utils;"
149+
cmd += "wget https://github.com/intel/libva-utils/archive/2.9.1.tar.gz -O libva-utils.tar.gz;"
150+
cmd += "tar zxf libva-utils.tar.gz --one-top-level=libva-utils --strip-components 1;"
151151
print cmd
152152
os.system(cmd);
153153

154154
print "media-driver"
155155
if not os.path.exists("%s/media-driver"%(WORKING_DIR)):
156-
cmd = "cd %s; rm -f intel-media-20.1.1.tar.gz;"%(WORKING_DIR)
157-
cmd += "wget https://github.com/intel/media-driver/archive/intel-media-20.1.1.tar.gz; "
158-
cmd += "tar zxf intel-media-20.1.1.tar.gz; mv media-driver-intel-media-20.1.1 media-driver"
156+
cmd = "cd %s; rm -f intel-media-20.3.0.tar.gz;"%(WORKING_DIR)
157+
cmd += "wget https://github.com/intel/media-driver/archive/intel-media-20.3.0.tar.gz; "
158+
cmd += "tar zxf intel-media-20.3.0.tar.gz --one-top-level=media-driver --strip-components 1"
159159
print cmd
160160
os.system(cmd);
161161

162162
print "gmmlib"
163163
if not os.path.exists("%s/gmmlib"%(WORKING_DIR)):
164-
cmd = "cd %s;rm -f intel-gmmlib-20.1.1.tar.gz; wget https://github.com/intel/gmmlib/archive/intel-gmmlib-20.1.1.tar.gz; "%(WORKING_DIR)
165-
cmd += "tar zxf intel-gmmlib-20.1.1.tar.gz; mv gmmlib-intel-gmmlib-20.1.1 gmmlib"
164+
cmd = "cd %s;rm -f intel-gmmlib-20.3.2.tar.gz; wget https://github.com/intel/gmmlib/archive/intel-gmmlib-20.3.2.tar.gz; "%(WORKING_DIR)
165+
cmd += "tar zxf intel-gmmlib-20.3.2.tar.gz --one-top-level=gmmlib --strip-components 1"
166166
print cmd
167167
os.system(cmd);
168168

169169
print "MediaSDK"
170170
if not os.path.exists("%s/MediaSDK"%(WORKING_DIR)):
171-
cmd = "cd %s; rm -f intel-mediasdk-20.1.1.tar.gz; wget https://github.com/Intel-Media-SDK/MediaSDK/archive/intel-mediasdk-20.1.1.tar.gz; "%(WORKING_DIR)
172-
cmd+= "tar zxf intel-mediasdk-20.1.1.tar.gz; mv MediaSDK-intel-mediasdk-20.1.1 MediaSDK"
171+
cmd = "cd %s; rm -f intel-mediasdk-20.3.0.tar.gz; wget https://github.com/Intel-Media-SDK/MediaSDK/archive/intel-mediasdk-20.3.0.tar.gz;"%(WORKING_DIR)
172+
cmd+= "tar zxf intel-mediasdk-20.3.0.tar.gz --one-top-level=MediaSDK --strip-components 1"
173173
print cmd
174174
os.system(cmd);
175175

@@ -181,7 +181,6 @@ def fnParseCommandline():
181181
print "************************************************************************"
182182

183183
# Build and install libVA including the libVA utils for vainfo.
184-
# libVA origin:fbf7138389f7d6adb6ca743d0ddf2dbc232895f6 (011118), libVA utils origin: 7b85ff442d99c233fb901a6fe3407d5308971645 (011118)
185184
cmd ="cd %s/libva; "%(WORKING_DIR)
186185
cmd+="./autogen.sh --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu; make -j4; sudo make install"
187186
print cmd

0 commit comments

Comments
 (0)