Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 3.32 KB

File metadata and controls

99 lines (73 loc) · 3.32 KB
################################################################################
#
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
################################################################################

YOLOv4 and DeepStream

This sample shows how to integrate YOLOv4 with customized output layer parsing for detected objects with DeepStreamSDK.

1. Sample contents:

  • deepstream_app_config_yolov4.txt: DeepStream reference app configuration file for using YOLOv4 model as the primary detector.
  • config_infer_primary_yolov4.txt: Configuration file for the GStreamer nvinfer plugin for the Yolo detector model.
  • nvdsinfer_custom_impl_Yolo/nvdsparsebbox_Yolo.cpp: Output layer parsing function for detected objects for the Yolo model.

2. Pre-requisites:

2.1 Please make sure DeepStream 5.0 is properly installed

2.2 Generate YOLOv4 TensorRT Engine

3. Deploy TensorRT Engine into DeepStream

3.1 Copy this directory deepstream_yolov4 into <where_deepstream_is_installed>/deepstream-5.0/sources

3.2 Compile nvdsparsebbox_Yolo.cpp in directory nvdsinfer_custom_impl_Yolo

  $ export CUDA_VER=<CUDA version of your environment, e.g. 10, 10.2, 11, etc>
  $ make

3.3 Copy the TensorRT engine into your working directory (<where_deepstream_is_installed>/deepstream-5.0/sources/deepstream_yolov4)

4. Update config_infer_primary_yoloV4.txt and deepstream_app_config_yoloV4.txt

4.1 Key options in config_infer_primary_yoloV4.txt that you may update for your own model

  • [property]

    • model-engine-file
    • labelfile-path
    • batch-size
    • network-mode
  • [class-attrs-all]

    • nms-iou-threshold
    • pre-cluster-threshold

Please refer to DeepStream plugin document for more information about plugin options

4.2 Key options in deepstream_app_config_yoloV4.txt that you may update for your own model

  • [tiled-display]

    • width
    • height
  • [streammux]

    • batch-size
    • width
    • height
  • [primary-gie]

    • model-engine-file (the same as in [property])
    • labelfile-path (the same as in [property])
    • batch-size (the same as in [property])
  • [tracker]

    • tracker-width
    • tracker-height

Please refer to DeepStream plugin document for more information about plugin options

5. Run the sample

  $ deepstream-app -c deepstream_app_config_yoloV4.txt