DeepStream-Yolo

marcoslucianopsMIT更新放缓

把 YOLO 系列模型接入 NVIDIA DeepStream SDK 的推理实现,支持 Darknet、PyTorch、Paddle 等多种权重格式,方便在 Jetson 和 GPU 上做实时目标检测部署。

NVIDIA DeepStream SDK 8.0 / 7.1 / 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 implementation for YOLO models

暂无版本2,077star464fork同步于 2026-11-07 07:30 UTC

怎么上手

由 README 提炼,执行前请确认
git clone https://github.com/marcoslucianops/DeepStream-Yolo.git
cd DeepStream-Yolo
硬件要求按 README 说明

需 NVIDIA GPU 与对应 DeepStream SDK 版本;x86 平台按 SDK 版本要求 Ubuntu 18.04~24.04、指定 CUDA/TensorRT/驱动版本,Jetson 平台需对应 JetPack(如 8.0 需 JetPack 7.0)。README 未给出具体显存要求。

需要 CUDA
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

把各类 YOLO 模型接入 NVIDIA DeepStream 的配置与解析器集合,省去自己写推理后处理

把 YOLO 系列模型接入 NVIDIA DeepStream SDK 的推理实现,支持 Darknet、PyTorch、Paddle 等多种权重格式,方便在 Jetson 和 GPU 上做实时目标检测部署。

核心能力

  • 提供 GPU bbox parser 做检测框解析后处理
  • 支持 ONNX 转换接入 YOLOv5 到 YOLOv13 及 RT-DETR 等模型
  • 支持 Darknet cfg/weights 转换并走 GPU 后处理
  • 支持 INT8 校准(PTQ)与动态 batch size
  • 支持非正方形输入模型与自定义 ONNX 模型解析

容易踩的坑

DeepStream、CUDA、TensorRT、驱动版本必须严格匹配 README 对应版本组合;需先用仓库内新的导出文件重新导出 ONNX 并重新生成 TensorRT engine;还需按模型选用新的 config_infer_primary 配置文件。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    DeepStream-Yolo

    NVIDIA DeepStream SDK 8.0 / 7.1 / 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 configuration for YOLO models


    For now, I am limited for some updates. Thank you for understanding.


    YOLO-Pose: https://github.com/marcoslucianops/DeepStream-Yolo-Pose

    YOLO-Seg: https://github.com/marcoslucianops/DeepStream-Yolo-Seg

    YOLO-Face: https://github.com/marcoslucianops/DeepStream-Yolo-Face


    Important: please export the ONNX model with the new export file, generate the TensorRT engine again with the updated files, and use the new config_infer_primary file according to your model


    Improvements on this repository

    • Support for INT8 calibration
    • Support for non square models
    • Models benchmarks
    • Support for Darknet models (YOLOv4, etc) using cfg and weights conversion with GPU post-processing
    • Support for YOLO-Master, YOLO26, RF-DETR, D-FINE, RT-DETR, CO-DETR (MMDetection), YOLO-NAS, PPYOLOE+, PPYOLOE, DAMO-YOLO, Gold-YOLO, RTMDet (MMYOLO), YOLOX, YOLOR, YOLOv13, YOLOv12, YOLO11, YOLOv10, YOLOv9, YOLOv8, YOLOv7, YOLOv6, YOLOv5u and YOLOv5 using ONNX conversion with GPU post-processing
    • GPU bbox parser
    • Custom ONNX model parser
    • Dynamic batch-size
    • INT8 calibration (PTQ) for Darknet and ONNX exported models

    Getting started

    Requirements

    DeepStream 8.0 on x86 platform
    DeepStream 7.1 on x86 platform
    DeepStream 7.0 on x86 platform
    DeepStream 6.4 on x86 platform
    DeepStream 6.3 on x86 platform
    DeepStream 6.2 on x86 platform
    DeepStream 6.1.1 on x86 platform
    DeepStream 6.1 on x86 platform
    DeepStream 6.0.1 / 6.0 on x86 platform
    DeepStream 5.1 on x86 platform
    DeepStream 8.0 on Jetson platform
    DeepStream 7.1 on Jetson platform
    DeepStream 7.0 on Jetson platform
    DeepStream 6.4 on Jetson platform
    DeepStream 6.3 on Jetson platform
    DeepStream 6.2 on Jetson platform
    DeepStream 6.1.1 on Jetson platform
    DeepStream 6.1 on Jetson platform
    DeepStream 6.0.1 / 6.0 on Jetson platform
    DeepStream 5.1 on Jetson platform

    Supported models

    Basic usage

    1. Download the repo
    git clone https://github.com/marcoslucianops/DeepStream-Yolo.git
    cd DeepStream-Yolo
    
    2. Download the cfg and weights files from Darknet repo to the DeepStream-Yolo folder
    3. Compile the lib

    3.1. Set the CUDA_VER according to your DeepStream version

    export CUDA_VER=XY.Z
    
    • x86 platform

      DeepStream 8.0 = 12.8
      DeepStream 7.1 = 12.6
      DeepStream 7.0 / 6.4 = 12.2
      DeepStream 6.3 = 12.1
      DeepStream 6.2 = 11.8
      DeepStream 6.1.1 = 11.7
      DeepStream 6.1 = 11.6
      DeepStream 6.0.1 / 6.0 = 11.4
      DeepStream 5.1 = 11.1
      
    • Jetson platform

      DeepStream 8.0 = 13.0
      DeepStream 7.1 = 12.6
      DeepStream 7.0 / 6.4 = 12.2
      DeepStream 6.3 / 6.2 / 6.1.1 / 6.1 = 11.4
      DeepStream 6.0.1 / 6.0 / 5.1 = 10.2
      

    3.2. Make the lib

    make -C nvdsinfer_custom_impl_Yolo clean && make -C nvdsinfer_custom_impl_Yolo
    
    4. Edit the config_infer_primary.txt file according to your model (example for YOLOv4)
    [property]
    ...
    custom-network-config=yolov4.cfg
    model-file=yolov4.weights
    ...
    

    NOTE: For Darknet models, by default, the dynamic batch-size is set. To use static batch-size, uncomment the line

    ...
    force-implicit-batch-dim=1
    ...
    
    5. Run
    deepstream-app -c deepstream_app_config.txt
    

    NOTE: The TensorRT engine file may take a very long time to generate (sometimes more than 10 minutes).

    NOTE: If you want to use YOLOv2 or YOLOv2-Tiny models, change the deepstream_app_config.txt file before run it

    ...
    [primary-gie]
    ...
    config-file=config_infer_primary_yoloV2.txt
    ...
    

    Docker usage

    • x86 platform

      nvcr.io/nvidia/deepstream:8.0-gc-triton-devel
      nvcr.io/nvidia/deepstream:8.0-triton-multiarch
      
    • Jetson platform

      nvcr.io/nvidia/deepstream:8.0-triton-multiarch
      

    NOTE: To compile the nvdsinfer_custom_impl_Yolo, you need to install the g++ inside the container

    apt-get install build-essential
    

    NOTE: With DeepStream 8.0, the docker containers do not package libraries necessary for certain multimedia operations like audio data parsing, CPU decode, and CPU encode. This change could affect processing certain video streams/files like mp4 that include audio track. Please run the below script inside the docker images to install additional packages that might be necessary to use all of the DeepStreamSDK features:

    /opt/nvidia/deepstream/deepstream/user_additional_install.sh
    

    NMS Configuration

    To change the nms-iou-threshold, pre-cluster-threshold and topk values, modify the config_infer file

    [class-attrs-all]
    nms-iou-threshold=0.45
    pre-cluster-threshold=0.25
    topk=300
    

    NOTE: Make sure to set cluster-mode=2 in the config_infer file.

    Notes

    1. Sometimes while running gstreamer pipeline or sample apps, user can encounter error: GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument. Aborting.. The issue is caused because of a bug in glib 2.0-2.72 version which comes with Ubuntu 22.04 by default. The issue is addressed in glib 2.76 and its installation is required to fix the issue (https://github.com/GNOME/glib/tree/2.76.6).

      • Migrate glib to newer version

        pip3 install meson
        pip3 install ninja
        

        NOTE: It is recommended to use Python virtualenv.

        git clone https://github.com/GNOME/glib.git
        cd glib
        git checkout 2.76.6
        meson build --prefix=/usr
        ninja -C build/
        cd build/
        ninja install
        
      • Check and confirm the newly installed glib version:

        pkg-config --modversion glib-2.0
        
    2. Sometimes with RTSP streams the application gets stuck on reaching EOS. This is because of an issue in rtpjitterbuffer component. To fix this issue, a script has been provided with required details to update gstrtpmanager library.

      /opt/nvidia/deepstream/deepstream/update_rtpmanager.sh
      

    Extract metadata

    You can get metadata from DeepStream using Python and C/C++. For C/C++, you can edit the deepstream-app or deepstream-test codes. For Python, your can install and edit deepstream_python_apps.

    Basically, you need manipulate the NvDsObjectMeta (Python / C/C++) and NvDsFrameMeta (Python / C/C++) to get the label, position, etc. of bboxes.

    My projects: https://www.youtube.com/MarcosLucianoTV