1.Install DeepStream SDK - 4.0.2
https://docs.nvidia.com/metropolis/deepstream/dev-guide/
最容易的方式是Method 3 以Debian package安裝, 相依的套件會全部自動安裝
$ sudo apt-get install ./deepstream-4.0_4.0.2-1_arm64.deb
安裝完成後 DeepStream SDK 在 /opt/nvidia/deepstream/deepstream-4.0
$ cd /opt/nvidia/deepstream/deepstream-4.0/sources/apps/sample_apps/deepstream-test1
編輯檔案 dstest1_pgie_config.txt, 修改network-mode (0 : FP32, 1 : Int8, 2 : FP16)
因為 Jetson Naon 不支援 Int8 inference
network-mode=2
$ deepstream-test1-app /opt/nvidia/deepstream/deepstream-4.0/samples/streams/sample_720p.h264
執行後要等一陣子產生model engine之後才以此處理並輸出影像串流
執行完成後model engine file會儲存起來,這時再度編輯dstest1_pgie_config.txt, 修改
model-engine-file=../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_fp16.engine
再次執行deepstream-test1-app就會直接使用之前產生的 .engine file
若出現以下錯誤
編輯 ~/.bashrc 在檔案最後加上
No EGL Display
nvbufsurftransform: Could not get EGL display connection
unset DISPLAY
export DISPLAY=:0
執行 source ~/.bashrc
修改 /etc/ssh/sshd_config
+ #X11Forwarding no
- X11Forwarding yes
執行 xrandr 確認 X11有跑起來
3.DeepStream Application
由以上的測試範例可知DeepStream Application是以c code來寫程式組合GStreamer串流, Inference則以 .txt 作為設定檔, 設定串流的source / sink, inference的各項參數等等
Yolo物件辨識的範例
$ cd /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_Yolo
$ ./prebuild.sh
$ cd nvdsinfer_custom_impl_Yolo/
$ export CUDA_VER=10.0
$ make
$ cd ../
採用YoloV3 tiny
編輯 config_infer_primary_yoloV3_tiny.txt, 修改network-mode (0 : FP32, 1 : Int8, 2 : FP16)
#network-mode=1
network-mode=2
network-mode=2
model-engine-file=model_b1_fp16.engine
$ deepstream-app -c deepstream_app_config_yoloV3_tiny.txt
Using winsys: x11
Creating LL OSD context new
Deserialize yoloLayerV3 plugin: yolo_17
Deserialize yoloLayerV3 plugin: yolo_24
Runtime commands:
h: Print this help
q: Quit
p: Pause
r: Resume
NOTE: To expand a source in the 2D tiled display and view object details, left-click on the source.
To go back to the tiled display, right-click anywhere on the window.
**PERF: FPS 0 (Avg)
**PERF: 0.00 (0.00)
** INFO: <bus_callback:189>: Pipeline ready
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 261
NVMEDIA: Reading vendor.tegra.display-size : status: 6
NvMMLiteBlockCreate : Block : BlockType = 261
** INFO: <bus_callback:175>: Pipeline running
Creating LL OSD context new
**PERF: 29.62 (29.62)
**PERF: 29.80 (29.71)
**PERF: 29.94 (29.79)
**PERF: 29.78 (29.79)
**PERF: 29.92 (29.81)
**PERF: 29.61 (29.78)
**PERF: 29.69 (29.77)
**PERF: 29.66 (29.75)
**PERF: 29.80 (29.76)
** INFO: <bus_callback:212>: Received EOS. Exiting ...
Quitting
App run successful
沒有留言:
張貼留言