美文网首页
Jetpack4.6+Deepstream6.0+Yolov5安

Jetpack4.6+Deepstream6.0+Yolov5安

作者: georgeguo | 来源:发表于2022-08-27 10:23 被阅读0次

1 安装Deepstream

2 yolov5转换

2.1 编译插件DeepStream-Yolo

2.2 yolov5转换成wts

  • 下载yolov5项目:https://github.com/ultralytics/yolov5
  • 将DeepStream-Yolo项目中utils/gen_wts_yoloV5.py拷贝到yolov5项目目录下,因为该脚本依赖了yolov5中utils中的内容
  • 执行python3 gen_wts_yoloV5.py -w WEIGHT -s SIZE生成cfg和wts文件【一定要在这一步指定模型的输入尺寸】

2.3 配置config_infer_primary_yoloV5.txt

[property]
gpu-id=0
net-scale-factor=0.0039215697906911373
model-color-format=0
custom-network-config=yolov5s.cfg  # cfg文件路径
model-file=yolov5s.wts  # wts文件路径
model-engine-file=model_b1_gpu0_fp32.engine
#int8-calib-file=calib.table
labelfile-path=labels.txt
batch-size=1
network-mode=0
num-detected-classes=80
interval=0
gie-unique-id=1
process-mode=1
network-type=0
cluster-mode=2
maintain-aspect-ratio=1
parse-bbox-func-name=NvDsInferParseYolo
custom-lib-path=nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so
engine-create-func-name=NvDsInferYoloCudaEngineGet

[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300
  • custom-network-config=yolov5s.cfg # cfg文件路径
  • model-file=yolov5s.wts # wts文件路径
  • model-engine-file=model_b1_gpu0_fp32.engine,可以默认不修改,若无该文件将在第一期deepstream启动时自动根据wts和cfg生成model_b1_gpu0_fp32.engine。

2.4 执行deepsteam-app命令,生成engine文件并开始推理。

3 PythonSDK调用

问题1:执行deepstream-test1时出现下面错误

File "deepstream_test_1.py", line 55, in osd_sink_pad_buffer_probe
    batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
AttributeError: module 'pyds' has no attribute 'gst_buffer_get_nvds_batch_meta

参考解决方案1:

Pyds In the use of probe extract Metadata Key information in , To use NVIDIA Compiled package , Not directly pip install The way , Otherwise, the corresponding method file will be missing , If the report is wrong :

AttributeError: module 'pyds' has no attribute 'gst_buffer_get_nvds_batch_meta'

The correct way is to download the compiled compressed package file , Download after decompression and download after decompression python/bindings In the path , According to their own platform , Such as jetson Copied to the /home/<user>/.local/lib/python<python-version>/site-packages/pyds.so In the path

此处pyds不是通过 pip3 install pyds安装的,它是nvidia提供的捆绑软件中的一个库deepstream_python_v0.9.tbz2下载地址。解压并安装。

tar jxvf deepstream_python_v0.9.tbz2
mkdir -p /home/<user>/.local/lib/python3.6/site-packages/
cp deepstream_python_v0.9/python/bindings/jetson/pyds.so  ~/.local/lib/python3.6/site-packages

相关文章

  • Jetpack4.6+Deepstream6.0+Yolov5安

    1 安装Deepstream 安装DeepStream 6.0.1【官方教程】:https://docs.nvid...

  • 安 安

    睡前甜自己一下吧 听着入睡.....不管明天有多痛苦 先祝自己晚安!

  • 安 安

    想妳........

  • 名字大全

    安倾,安风,安战,安若素,安无令

  • 安其所安

    空气,微冷, 我沉浸在自己的故事里…… 不为晴天担忧, 因为它肯定会来; 不为阴天踯躅, 因为早晚会过去。 此时,...

  • 女人安,家庭安,天下安

    这几天联系求助的单位朋友,都是妈妈因为孩子的问题。问及家庭情况、建议父母和孩子一起咨询时,有很为难地说:“我...

  • 安盛安进储蓄计划官方介绍

    安盛安进储蓄计划怎么样?安盛安进储蓄计划是什么类型的产品?安盛安进储蓄计划收益怎么样?安盛安进储蓄计划稳定吗?安盛...

  • 试作篇·蹲安

    试作篇·蹲安 小提纲: 蹲安的语汇 蹲安的出处 蹲安的动作 蹲安动作上的可变性 蹲安的场合 蹲安的接安 某些清宫戏...

  • 4月,你好!

    我以温柔待世界,愿世界以安相待。 父母安,儿安,夫安,家安,业安,事事安。 17年的冬月,哥哥高热惊厥,当孩子的双...

  • 难安

    难安兮难安 思卿最难安 残月下江南 独夫空倚栏 难安兮难安 梦醒最难安 拥卿紫潭岸 卿化桃花瓣 难安兮难安 何时最...

网友评论

      本文标题:Jetpack4.6+Deepstream6.0+Yolov5安

      本文链接:https://www.haomeiwen.com/subject/ihhxnrtx.html