DeepStream推理dewarped所有surfaces

原视频\opt\nvidia\deepstream\deepstream\samples\streams\sample_cam6.mp4如上图所示,是一个360度的球型视频,DeepStream的nvdewarper插件可以将原视频拆分成多个单独的视频,nvdewarper可以生成最大4个dewarped surfaces.

\opt\nvidia\deepstream\deepstream-7.1\sources\apps\sample_apps\deepstream-dewarper-test例子只是将nvdewarper拆分的视频进行显示,并没有做推理,pipeline是source->dewarper->nvstreammux->tiler->sink.

deepstream-app可以支持对nvdewarper拆分的视频进行推理,

source2_dewarper_test.yml内容如下:

bash 复制代码
####################################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
####################################################################################################

application:
  enable-perf-measurement: 1
  perf-measurement-interval-sec: 5
  gie-kitti-output-dir: streamscl

tiled-display:
  enable: 1
  rows: 1
  columns: 2
  width: 1920
  height: 1080
  gpu-id: 0
  #(0): nvbuf-mem-default - Default memory allocated, specific to particular platform
  #(1): nvbuf-mem-cuda-pinned - Allocate Pinned/Host cuda memory applicable for Tesla
  #(2): nvbuf-mem-cuda-device - Allocate Device cuda memory applicable for Tesla
  #(3): nvbuf-mem-cuda-unified - Allocate Unified cuda memory applicable for Tesla
  #(4): nvbuf-mem-surface-array - Allocate Surface Array memory, applicable for Jetson
  nvbuf-memory-type: 0

source:
  csv-file-path: sources_2.csv

sink0:
  enable: 1
  #Type - 1=FakeSink 2=EglSink 3=File
  type: 2
  sync: 1
  source-id: 0
  gpu-id: 0
  nvbuf-memory-type: 0

sink1:
  enable: 1
  type: 3
  #1=mp4 2=mkv
  container: 1
  #1=h264 2=h265
  codec: 1
  #encoder type 0=Hardware 1=Software
  enc-type: 0
  sync: 0
  #iframeinterval=10
  bitrate: 2000000
  #H264 Profile - 0=Baseline 2=Main 4=High
  #H265 Profile - 0=Main 1=Main10
  # set profile only for hw encoder, sw encoder selects profile based on sw-preset
  profile: 0
  output-file: out.mp4
  source-id: 0

# "num-surfaces-per-frame" in all dewarper configs should be same
# and should be equal to "num-surfaces-per-frame" in "streammux" config

# following config is applicable to [source0]
dewarper0:
  enable: 1
  source-id: 6
  config-file: /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-dewarper-test/config_dewarper.txt
  gpu-id: 0
  nvbuf-memory-type: 0
  num-output-buffers: 4

# following config is applicable to [source1]
dewarper1:
  enable: 1
  #Camera Id
  source-id: 11
  config-file: /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-dewarper-test/config_dewarper.txt
  gpu-id: 0
  nvbuf-memory-type: 0
  num-output-buffers: 4
  num-batch-buffers: 4

osd:
  enable: 1
  gpu-id: 0
  border-width: 1
  text-size: 15
  text-color: 1;1;1;1
  text-bg-color: 0.3;0.3;0.3;1
  font: Serif
  show-clock: 0
  clock-x-offset: 800
  clock-y-offset: 820
  clock-text-size: 12
  clock-color: 1;0;0;0
  nvbuf-memory-type: 0
  display-mask: 1

streammux:
  gpu-id: 0
  ##Boolean property to inform muxer that sources are live
  batch-size: 8
  ##time out in usec, to wait after the first buffer is available
  ##to push the batch even if the complete batch is not formed
  batched-push-timeout: 33000
  ## Set muxer output width and height
  width: 960
  height: 752
  ##Enable to maintain aspect ratio wrt source, and allow black borders, works
  ##along with width, height properties
  enable-padding: 0
  nvbuf-memory-type: 0
  num-surfaces-per-frame: 4
  ## If set to TRUE, system timestamp will be attached as ntp timestamp
  ## If set to FALSE, ntp timestamp from rtspsrc, if available, will be attached
  # attach-sys-ts-as-ntp: 1


primary-gie:
  enable: 1
  gpu-id: 0
  model-engine-file: ../../models/Primary_Detector/resnet18_trafficcamnet_pruned.onnx_b4_gpu0_int8.engine
  batch-size: 4
  #Required by the app for OSD, not a plugin property
  bbox-border-color0: 1;0;0;1
  bbox-border-color1: 0;1;1;1
  bbox-border-color2: 0;0;1;1
  bbox-border-color3: 0;1;0;1
  interval: 0
  gie-unique-id: 1
  nvbuf-memory-type: 0
  config-file: config_infer_primary.yml

tests:
  file-loop: 0

sources_2.csv内容如下:

bash 复制代码
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NvidiaProprietary
#
# NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
# property and proprietary rights in and to this material, related
# documentation and any modifications thereto. Any use, reproduction,
# disclosure or distribution of this material and related documentation
# without an express license agreement from NVIDIA CORPORATION or
# its affiliates is strictly prohibited.
enable,type,uri,num-sources,gpu-id,cudadec-memtype
1,3,file://../../streams/sample_cam6.mp4,1,0,0
1,3,file://../../streams/sample_cam6.mp4,1,0,0

命令如下:deepsteram-app -c source2_dewarper_test.yml

结果如下:

可以看到,源有两个,每个源可以分成4个单独的图像,nvinfer再对8个单独图像做推理,画面上都有bbox。

相关推荐
weixin_457297103 分钟前
RAG流程全解析:从数据到精准答案
人工智能
whaosoft-1433 分钟前
51c大模型~合集171
人工智能
arron889917 分钟前
YOLOv8n-pose 模型使用
人工智能·深度学习·yolo
AI人工智能+1 小时前
一种融合AI与OCR的施工许可证识别技术,提升工程监管效率,实现自动化、精准化处理。
人工智能·自动化·ocr·施工许可证识别
大力水手(Popeye)2 小时前
Pytorch——tensor
人工智能·pytorch·python
ygy.白茶3 小时前
从电影分类到鸢尾花识别
人工智能
AI_gurubar6 小时前
大模型教机器人叠衣服:2025年”语言理解+多模态融合“的智能新篇
人工智能·机器人
飞翔的佩奇6 小时前
【完整源码+数据集+部署教程】表盘指针检测系统源码和数据集:改进yolo11-CA-HSFPN
python·yolo·计算机视觉·数据集·yolo11·表盘指针检测
XINVRY-FPGA8 小时前
EPM240T100I5N Altera FPGA MAX II CPLD
人工智能·嵌入式硬件·fpga开发·硬件工程·dsp开发·射频工程·fpga
HuggingFace8 小时前
开源开发者须知:欧盟《人工智能法案》对通用人工智能模型的最新要求
人工智能