资源算法jetson-inference

jetson-inference

2019-12-31 | |  59 |   0 |   0

Deploying Deep Learning

Welcome to our instructional guide for inference and realtime DNN vision library for NVIDIA Jetson Nano/TX1/TX2/Xavier.

This repo uses NVIDIA TensorRT for efficiently deploying neural networks onto the embedded Jetson platform, improving performance and power efficiency using graph optimizations, kernel fusion, and FP16/INT8 precision.

Vision primitives, such as imageNet for image recognition, detectNet for object localization, and segNet for semantic segmentation, inherit from the shared tensorNet object.  Examples are provided for streaming from live camera feed and processing images.  See the API Reference section for detailed reference documentation of the C++ and Python libraries.

There are multiple tracks of the tutorial that you can choose to follow, including Hello AI World for running inference and transfer learning onboard your Jetson, or the full Two Days to a Demo tutorial for training on a PC or server with DIGITS.

It's recommended to walk through the Hello AI World module first to familiarize yourself with machine learning and inference with TensorRT, before proceeding to training in the cloud with DIGITS.

Table of Contents

>   Jetson Nano Developer Kit and JetPack 4.3 is now supported in the repo.
>   See our latest technical blog including benchmarks, Jetson Nano Brings AI Computing to Everyone.
>   Hello AI World now supports Python and onboard training with PyTorch!

Hello AI World

Hello AI World can be run completely onboard your Jetson, including inferencing with TensorRT and transfer learning with PyTorch.  The inference portion of Hello AI World - which includes coding your own image classification application for C++ or Python, object detection, and live camera demos - can be run on your Jetson in roughly two hours or less, while transfer learning is best left to leave running overnight.

Two Days to a Demo (DIGITS)

The full tutorial includes training in the cloud or PC, and inference on the Jetson with TensorRT, and can take roughly two days or more depending on system setup, downloading the datasets, and the training speed of your GPU.

API Reference

Below are links to reference documentation for the C++ and Python libraries from the repo:

jetson-inference


C++Python
Image RecognitionimageNetimageNet
Object DetectiondetectNetdetectNet
SegmentationsegNetsegNet

jetson-utils

These libraries are able to be used in external projects by linking to libjetson-inference and libjetson-utils.

Code Examples

Introductory code walkthroughs of using the library are covered during these steps of the Hello AI World tutorial:

Additional C++ and Python samples for running the networks on static images and live camera streams can be found here:


ImagesCamera
C++ (examples)

   Image Recognitionimagenet-consoleimagenet-camera
   Object Detectiondetectnet-consoledetectnet-camera
   Segmentationsegnet-consolesegnet-camera
Python (python/examples)

   Image Recognitionimagenet-console.pyimagenet-camera.py
   Object Detectiondetectnet-console.pydetectnet-camera.py
   Segmentationsegnet-console.pysegnet-camera.py

note:  for working with numpy arrays, see cuda-from-numpy.py and cuda-to-numpy.py

These examples will automatically be compiled while Building the Project from Source, and are able to run the pre-trained models listed below in addition to custom models provided by the user.  Launch each example with --help for usage info.

Pre-Trained Models

The project comes with a number of pre-trained models that are available through the Model Downloader tool:

Image Recognition

NetworkCLI argumentNetworkType enum
AlexNetalexnetALEXNET
GoogleNetgooglenetGOOGLENET
GoogleNet-12googlenet-12GOOGLENET_12
ResNet-18resnet-18RESNET_18
ResNet-50resnet-50RESNET_50
ResNet-101resnet-101RESNET_101
ResNet-152resnet-152RESNET_152
VGG-16vgg-16VGG-16
VGG-19vgg-19VGG-19
Inception-v4inception-v4INCEPTION_V4

Object Detection

NetworkCLI argumentNetworkType enumObject classes
SSD-Mobilenet-v1ssd-mobilenet-v1SSD_MOBILENET_V191 (COCO classes)
SSD-Mobilenet-v2ssd-mobilenet-v2SSD_MOBILENET_V291 (COCO classes)
SSD-Inception-v2ssd-inception-v2SSD_INCEPTION_V291 (COCO classes)
DetectNet-COCO-Dogcoco-dogCOCO_DOGdogs
DetectNet-COCO-Bottlecoco-bottleCOCO_BOTTLEbottles
DetectNet-COCO-Chaircoco-chairCOCO_CHAIRchairs
DetectNet-COCO-Airplanecoco-airplaneCOCO_AIRPLANEairplanes
ped-100pednetPEDNETpedestrians
multiped-500multipedPEDNET_MULTIpedestrians, luggage
facenet-120facenetFACENETfaces

Semantic Segmentation

DatasetResolutionCLI ArgumentAccuracyJetson NanoJetson Xavier
Cityscapes512x256fcn-resnet18-cityscapes-512x25683.3%48 FPS480 FPS
Cityscapes1024x512fcn-resnet18-cityscapes-1024x51287.3%12 FPS175 FPS
Cityscapes2048x1024fcn-resnet18-cityscapes-2048x102489.6%3 FPS47 FPS
DeepScene576x320fcn-resnet18-deepscene-576x32096.4%26 FPS360 FPS
DeepScene864x480fcn-resnet18-deepscene-864x48096.9%14 FPS190 FPS
Multi-Human512x320fcn-resnet18-mhp-512x32086.5%34 FPS370 FPS
Multi-Human640x360fcn-resnet18-mhp-512x32087.1%23 FPS325 FPS
Pascal VOC320x320fcn-resnet18-voc-320x32085.9%45 FPS508 FPS
Pascal VOC512x320fcn-resnet18-voc-512x32088.5%34 FPS375 FPS
SUN RGB-D512x400fcn-resnet18-sun-512x40064.3%28 FPS340 FPS
SUN RGB-D640x512fcn-resnet18-sun-640x51265.1%17 FPS224 FPS
  • If the resolution is omitted from the CLI argument, the lowest resolution model is loaded

  • Accuracy indicates the pixel classification accuracy across the model's validation dataset

  • Performance is measured for GPU FP16 mode with JetPack 4.2.1, nvpmodel 0 (MAX-N)

Legacy Segmentation Models

Recommended System Requirements

Training GPU:  Maxwell, Pascal, Volta, or Turing-based GPU (ideally with at least 6GB video memory)
                        optionally, AWS P2/P3 instance or Microsoft Azure N-series
                        Ubuntu 16.04/18.04 x86_64

Deployment:      Jetson Nano Developer Kit with JetPack 4.2 or newer (Ubuntu 18.04 aarch64).
                        Jetson Xavier Developer Kit with JetPack 4.0 or newer (Ubuntu 18.04 aarch64)
                        Jetson TX2 Developer Kit with JetPack 3.0 or newer (Ubuntu 16.04 aarch64).
                        Jetson TX1 Developer Kit with JetPack 2.3 or newer (Ubuntu 16.04 aarch64).

Note that TensorRT samples from the repo are intended for deployment onboard Jetson, however when cuDNN and TensorRT have been installed on the host side, the TensorRT samples in the repo can be compiled for PC.

Extra Resources

In this area, links and resources for deep learning are listed:

Legacy Links

Since the documentation has been re-organized, below are links mapping the previous content to the new locations.       (click on the arrow above to hide this section)

DIGITS Workflow

See DIGITS Workflow

System Setup

See DIGITS Setup

Running JetPack on the Host

See JetPack Setup

Installing Ubuntu on the Host

See DIGITS Setup

Setting up host training PC with NGC container

See DIGITS Setup

Installing the NVIDIA driver

See DIGITS Setup

Installing Docker

See DIGITS Setup

NGC Sign-up

See DIGITS Setup

Setting up data and job directories

See DIGITS Setup

Starting DIGITS container

See DIGITS Setup

Natively setting up DIGITS on the Host

See DIGITS Native Setup

Installing NVIDIA Driver on the Host

See DIGITS Native Setup

Installing cuDNN on the Host

See DIGITS Native Setup

Installing NVcaffe on the Host

See DIGITS Native Setup

Installing DIGITS on the Host

See DIGITS Native Setup

Starting the DIGITS Server

See DIGITS Native Setup

Building from Source on Jetson

See Building the Repo from Source

Cloning the Repo

See Building the Repo from Source

Configuring with CMake

See Building the Repo from Source

Compiling the Project

See Building the Repo from Source

Digging Into the Code

See Building the Repo from Source

Classifying Images with ImageNet

See Classifying Images with ImageNet

Using the Console Program on Jetson

See Classifying Images with ImageNet

Running the Live Camera Recognition Demo

See Running the Live Camera Recognition Demo

Re-training the Network with DIGITS

See Re-Training the Recognition Network

Downloading Image Recognition Dataset

See Re-Training the Recognition Network

Customizing the Object Classes

See Re-Training the Recognition Network

Importing Classification Dataset into DIGITS

See Re-Training the Recognition Network

Creating Image Classification Model with DIGITS

See Re-Training the Recognition Network

Testing Classification Model in DIGITS

See Re-Training the Recognition Network

Downloading Model Snapshot to Jetson

See Downloading Model Snapshots to Jetson

Loading Custom Models on Jetson

See Loading Custom Models on Jetson

Locating Object Coordinates using DetectNet

See Locating Object Coordinates using DetectNet

Detection Data Formatting in DIGITS

See Locating Object Coordinates using DetectNet

Downloading the Detection Dataset

See Locating Object Coordinates using DetectNet

Importing the Detection Dataset into DIGITS

See Locating Object Coordinates using DetectNet

Creating DetectNet Model with DIGITS

See Locating Object Coordinates using DetectNet

Selecting DetectNet Batch Size

See Locating Object Coordinates using DetectNet

Specifying the DetectNet Prototxt

See Locating Object Coordinates using DetectNet

Training the Model with Pretrained Googlenet

See Locating Object Coordinates using DetectNet

Testing DetectNet Model Inference in DIGITS

See Locating Object Coordinates using DetectNet

Downloading the Model Snapshot to Jetson

See Downloading the Detection Model to Jetson

DetectNet Patches for TensorRT

See Downloading the Detection Model to Jetson

Processing Images from the Command Line on Jetson

See Detecting Objects from the Command Line

Launching With a Pretrained Model

See Detecting Objects from the Command Line

Pretrained DetectNet Models Available

See Detecting Objects from the Command Line

Running Other MS-COCO Models on Jetson

See Detecting Objects from the Command Line

Running Pedestrian Models on Jetson

See Detecting Objects from the Command Line

Multi-class Object Detection Models

See Detecting Objects from the Command Line

Running the Live Camera Detection Demo on Jetson

See Running the Live Camera Detection Demo

Image Segmentation with SegNet

See Semantic Segmentation with SegNet

Downloading Aerial Drone Dataset

See Semantic Segmentation with SegNet

Importing the Aerial Dataset into DIGITS

See Semantic Segmentation with SegNet

Generating Pretrained FCN-Alexnet

See Generating Pretrained FCN-Alexnet

Training FCN-Alexnet with DIGITS

See Training FCN-Alexnet with DIGITS

Testing Inference Model in DIGITS

See Training FCN-Alexnet with DIGITS

FCN-Alexnet Patches for TensorRT

See FCN-Alexnet Patches for TensorRT

Running Segmentation Models on Jetson

See Running Segmentation Models on Jetson

© 2016-2019 NVIDIA | Table of Contents


上一篇:InferSent

下一篇:LittleInferenceBook

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • inferno-boilerplate

    This is a very basic boilerplate example for pe...