Git Product home page Git Product logo

deepstream-yolo3-gige-apps's Introduction


  • SPDX-License-Identifier: NVIDIA Corporation
  • Copyright (c) 2019-2022. All rights reserved.
  • NVIDIA Corporation and its licensors retain all intellectual property
  • and proprietary rights in and to this software, related documentation
  • and any modifications thereto. Any use, reproduction, disclosure or
  • distribution of this software and related documentation without an express
  • license agreement from NVIDIA Corporation is strictly prohibited.

Introduction

This deepstream-yolo3-gige application uses the Nvidia DeepStream-5.1 SDK to generate RTSP video stream on RTSP port, H264 encoded video, or display on screen after object detection.

This apps uses the Basler acA1920-25gc GigE camera (ethernet port) with the ARAVIS SDK [1] as the plugin. Also it takes advantages of Nvidia DeepStream-5.1 SDK with the Yolo3 Libraries for quick DS-5.1 application.

With the GigE camera in place, this application idea can be extended into many applications, such as the highway trafic follow monitoring, industrial production line for quality control, supermarket safety control, etc.

What is ARAVIS?

Aravis is a glib/gobject based library for video acquisition using Genicam cameras. It currently implements the gigabit ethernet and USB3 protocols used by the industrial cameras. It also provides a basic ethernet camera simulator and simple video viewer[1]. License requirement is under GNU General Public License, Version 2

How to Install ARAVIS?

download the aravis-0.6.0 (this version works for this apps at least) and put it in /src dir. as example. One can try the latest version as well.

  • cd aravis-0.6.0
  • ./configure --enable-viewer --prefix=/usr
  • make
  • make install
  • After get libgstaravis-0.6.so, one need to copy that file into /usr/lib/x86_64-linux-gnu for dGPU
    for Jetson devices, for example of Jetson NX, copy that file into /usr/lib/aarch64-linux-gnu

Prerequisites:

Please follow instructions in the apps/sample_apps/deepstream-app/README on how to install the prerequisites for Deepstream SDK, the DeepStream SDK itself and the apps.

One must have the following development packages installed

DeepStream Pipeline

  • DeepStream SDK is based on the GStreamer framework. GStreamer is a pipeline based multimedia framework that links together a wide variety of media processing systems to complete workflows. Following is the pipleline for this Yolo3 GiGE application which is based on the DL Yolo3 network for the Object Dectection.

gst-pipleline-png

This DeepStream Yolo3 GigE Apps Overview

  • This application takes advantages of Nvidia DeepStream-5.1 SDK on the Yolo3 Object Detection Libraries - no training needed

  • Nvidia Transfer Learning Toolkit 3.0 can be used for the re-train if one needs to use different dataset

  • The ARAVIS SDK and Basler GigE camera will be used for this application

  • Using TLT converter to generate the TRT engine file for the DeepStream Deployment for the Yolo3 GigE application if need re-train

  • User can make selection: generate the RTSP video stream, display the bounding box of object detection on screen, or save as a encoded H264 video file

How to Install VLC Media Player and to do Setting in VLC

  • In order to view the RTSP video stream on the RTSP port, one need to install the VLC with following command

    sudo apt install vlc qtwayland5

  • In the VLC, go to Media -> Open Network Stream and set the address rtsp://localhost:5001/ds-out-avc as example

How to Compile the Application Package

  • git clone this application into /opt/nvidia/deeepstream/deepstream-5.1/sources/apps/sample_apps

  • $ cd deepstream-yolov3-gige

  • If need to generate the H264 or display the video on the screen, do following:

    cp deepstream-yolov3-gige.c.h264 deepstream-yolov3-gige.c

  • $ sudo make clean && make

  • For Jetson edge device, e.g, Xavier NX: "nvbuf-memory-type", 0, is used while "nvbuf-memory-type", 3 is for dGPU in deepstream-yolov3-gige.c

How to Run this DeepStream Yolo3 GiGE Application

  • $ example: sudo ./deepstream_yolov3_gige 5000 5001 -- object detection results will be shown on the RTSP port: 5001 via VLC media player

  • $ example: sudo ./deepstream_yolov3_gige -- object detection results will be displayed on screen only

  • $ example: sudo ./deepstream_yolov3_gige out.h264 -- produce the video output file which is in encoded H264 format.

  • Example picture from the object detection result

yolo3-result

Nvidia Transfer Learning Toolkit 3.0 for Re-Training, Evaluation, Export, and Convert for Quick Deployment

  • No re-retraining is needed since DeepStream-5.1 has the Yolo3 library in. In case to do the re-training, please refer to following steps.

  • TLT Converter Information (include how to download) : https://developer.nvidia.com/tlt-get-started

  • Use Nvidia TLT 3.0 for Re-Training, Evaluation, Export, and Quick Deployment

  • Use the TLT to generate the .etlt and .engine file for the DeepStream application deployment after retraining

  • One can refer to Jupyter Notebook (yolo_v3.ipynb) for Yolo3 training based on the new dataset used

  • Refer to default_spec as the configuration file used by the Jupyter Notebook for the training, evaluation, export, and convert

  • Use the Jupyter Notebook to download the resenet_18 for yolov3 from Nvidia GPU Cloud : https://ngc.nvidia.com/

The information for Nvidia Transfer Learning Toolkit 3.0 User Guide for Yolo3

Quickly Deploying the Apps to DeepStream-5.1 Using Transfer Learning Toolkit-3.0

  • Use the .etlt or .engine file after TLT train, export, and coverter

  • Use the Jetson version of the tlt converter to generate the .engine file used in the Jetson devices

    example: ./tlt-converter -k $key -e trt.fp16.engine -t fp16 -p input_1 1,1x3x600x600, 4x3x600x600,16x3x600x600 frcnn_kitti_resnet50_retrain_fp16.etlt
    here: $key is the key when do the tlt training and 600x600 is the input/training image size as example

  • Define the .etlt or .engine file path in the config file for dGPU and Jetson for the DS-5.1 application

  • example: model-engine-file = trt.int8.engine in config_infer_primary_yoloV3.txt

  • The performance using different GPU devices

performance-jetson-dgpu

References

deepstream-yolo3-gige-apps's People

Contributors

qin53027 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.