Skip to content

About

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.

Resources

Stars

0 stars

Watchers

0 watching

Forks

ย 
ย 

Latest commit

ย 

History

1,521 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

  • Auto: ๊น€์ค€ํ˜ธ
  • Date: 2022-02-18

Deploying Deep Learning

NVIDIA์˜ Jetson Nano/TX1/TX2/Xavier NX/AGX Xavier ๋ฅผ ์‚ฌ์šฉํ•œ inference(์ถ”๋ก ) ์™€ realtime(์‹ค์‹œ๊ฐ„) DNN vision library๋ฅผ ์œ„ํ•œ guide์— ์˜ค์‹ ๊ฑธ ํ™˜์˜ํ•ฉ๋‹ˆ๋‹ค.

ํ•ด๋‹น repo๋Š” NVIDIA TensorRT ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์ด๋Š” graph optimizations, kernel fusion, FP16/INT8 precision ์„ ์ ์šฉํ•จ์œผ๋กœ์จ Jetson ํ”Œ๋žซํผ์—์„œ ์ธ๊ณต์‹ ๊ฒฝ๋ง์„ ๋” ๋น ๋ฅด๊ฒŒ, ๋” ์ ์€ ์—๋„ˆ์ง€๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ์ž…๋‹ˆ๋‹ค.

๋น„์ „์˜ ๊ธฐ์ดˆ, imageNet for image recognition(์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜), detectNet for object detection(๊ฐ์ฒด ๊ฒ€์ถœ), segNet for semantic segmentation, and poseNet for pose estimation, ๊ฐ ๋ชจ๋ธ๋“ค์€ shared tensorNet object ์—์„œ ์ƒ์†๋˜์–ด ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์˜ˆ์ œ๋กœ live camera๋กœ๋ถ€ํ„ฐ streaming ๋ฐ›๋Š” ๊ฒƒ๊ณผ ์ด๋ฏธ์ง€๋ฅผ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฒƒ์ด ์ œ๊ณต๋ฉ๋‹ˆ๋‹ค. ๋‹ค์Œ API Reference ์—์„œ C++, Python์— ๋Œ€ํ•œ ์ž์„ธํ•œ ์ž๋ฃŒ๋ฅผ ์ฐพ์•„๋ณด์‹ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Hello AI World ์—์„œ๋Š” jetson platform์—์„œ inference(์ถ”๋ก )๊ณผ transfer learning์„ ํ•˜๋Š” ํŠœํ† ๋ฆฌ์–ผ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์—ฌ๊ธฐ์„œ ์ง์ ‘ datasets์„ ์ˆ˜์ง‘ํ•˜๊ณ  ์ธ๊ณต์‹ ๊ฒฝ๋ง์„ ์ง์ ‘ ํ•™์Šต์‹œ์ผœ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŠœํ† ๋ฆฌ์–ผ์€ image classification(์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜), object detection(๊ฐ์ฒด ๊ฒ€์ถœ), sematic segmentation, pose estimation, mono depth๋ฅผ ๋‹ค๋ฃน๋‹ˆ๋‹ค.

๋ชฉ์ฐจ

> ย  JetPack 4.6 ์ด ์ง€์›๋ฉ๋‹ˆ๋‹ค. ๋ฌธ์„œ๋ฅผ ํ™•์ธํ•˜์„ธ์š”. updated containers.
> ย  Pose Estimation ์™€ Mono Depth ํŠœํ† ๋ฆฌ์–ผ์„ ํ•ด๋ณด์„ธ์š”!

Hello AI World

Hello AI Wolrd๋Š” jetson ๋ณด๋“œ์—์„œ ์ˆ˜ํ–‰๋  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ์ด๋Š” TensorRT๋ฅผ ํ†ตํ•œ inference(์ถ”๋ก )๊ณผ Pytorch๋ฅผ ์ด์šฉํ•œ transfer learning์„ ํฌํ•จํ•ฉ๋‹ˆ๋‹ค. inference ๋ถ€๋ถ„์€ Python๊ณผ C++๋กœ ์ง์ ‘ image classfication(์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜)์™€ object detectino(๊ฐ์ฒด ๊ฒ€์ถœ) application ์ฝ”๋“œ๋ฅผ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์ด๋ฃจ์–ด์ ธ์žˆ๊ณ  ์•ฝ 2์‹œ๊ฐ„ ์ •๋„๊ฐ€ ์†Œ์š”๋ฉ๋‹ˆ๋‹ค. ๋ฐ˜๋ฉด, tranfer learning์€ ๋ฐค์ƒˆ ์ˆ˜ํ–‰์‹œ์ผœ์ฃผ์‹œ๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.

์‹œ์Šคํ…œ ์„ค์ •

Inference(์ถ”๋ก )

Training(ํ›ˆ๋ จ)

Appendix

Video ๋ชฉ๋ก

์•„๋ž˜ ์˜์ƒ๋“ค์€ Jetson AI Certification ์ฝ”์Šค์—์„œ ์ œ๊ณต๋œ ๊ฒƒ์ž…๋‹ˆ๋‹ค.

Description Video
Hello AI World Setup
Jetson Nano์—์„œ Hello AI World ๋„์ปค ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋‹ค์šด๋กœ๋“œ ๋ฐ›๊ณ  run ํ•ฉ๋‹ˆ๋‹ค. ์นด๋ฉ”๋ผ๋ฅผ ํ…Œ์ŠคํŠธ ํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  RTP๋ฅผ ํ†ตํ•ด ๋„คํŠธ์›Œํฌ์— ์–ด๋–ป๊ฒŒ ์ŠคํŠธ๋ฆฌ๋ฐ ๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
Image Classification Inference
๋”ฅ๋Ÿฌ๋‹ ๊ธฐ์ˆ ๊ณผ Jetson Nano๋ฅผ ํ†ตํ•ด ์ˆ˜ํ–‰ํ•˜๋Š” ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ํ”„๋กœ๊ทธ๋žจ์„ ์ฝ”๋”ฉํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋ผ์ด๋ธŒ ์นด๋ฉ”๋ผ์—์„œ ์‹ค์‹œ๊ฐ„์œผ๋กœ ์ด๋ฏธ์ง€๋ฅผ ๋ถ„๋ฅ˜ํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
Training Image Classification Models
Jetson Nano์—์„œ ์–ด๋–ป๊ฒŒ Pytorch๋กœ ์ด๋ฏธ์ง€ ๋ถ„๋ฅ˜ ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๋Š”์ง€ ๋ฐฐ์›๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ปค์Šคํ…€ ๋ชจ๋ธ์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•œ datasets์„ ์ˆ˜์ง‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์›๋‹ˆ๋‹ค.
Object Detection Inference
๋”ฅ๋Ÿฌ๋‹ ๊ธฐ์ˆ ๊ณผ Jetson Nano๋ฅผ ํ†ตํ•ด ์ˆ˜ํ–‰ํ•˜๋Š” ๊ฐ์ฒด ๊ฒ€์ถœ ํ”„๋กœ๊ทธ๋žจ์„ ์ฝ”๋”ฉํ•ฉ๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ๋ผ์ด๋ธŒ ์นด๋ฉ”๋ผ์—์„œ ์‹ค์‹œ๊ฐ„์œผ๋กœ ๊ฐ์ฒด๋ฅผ ๊ฒ€์ถœํ•˜๋Š” ๊ฒƒ์„ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.
Training Object Detection Models
Jetson Nano์—์„œ ์–ด๋–ป๊ฒŒ Pytorch๋กœ ๊ฐ์ฒด ๊ฒ€์ถœ ๋ชจ๋ธ์„ ํ›ˆ๋ จํ•˜๋Š”์ง€ ๋ฐฐ์›๋‹ˆ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ปค์Šคํ…€ ๋ชจ๋ธ์„ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•œ datasets์„ ์ˆ˜์ง‘ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ๋ฐฐ์›๋‹ˆ๋‹ค.
Semantic Segmentation
Jetson Nano์—์„œ Semantic segmentation network๋ฅผ ๊ฒฝํ—˜ํ•ด๋ณด๊ณ  ์ด๋ฅผ ๋ผ์ด๋ธŒ ์นด๋ฉ”๋ผ๋กœ ์ž˜ ์ˆ˜ํ–‰๋˜๋Š”์ง€ ํ™•์ธํ•ฉ๋‹ˆ๋‹ค.

API Reference

์•„๋ž˜ ๋‘ ๋ฌธ์„œ ๋งํฌ๋Š” C++ and Python ํ•ด๋‹น repo์—์„œ ์‚ฌ์šฉํ•˜๋Š” API ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค.

jetson-inference

C++ Python
Image Recognition imageNet imageNet
Object Detection detectNet detectNet
Segmentation segNet segNet
Pose Estimation poseNet poseNet
Monocular Depth depthNet depthNet

jetson-utils

์œ„ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋“ค์€ libjetson-inference and libjetson-utils๋ฅผ ๋งํฌํ•จ์œผ๋กœ์จ ๋‹ค๋ฅธ ํ”„๋กœ์ ํŠธ์—์„œ๋„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ฝ”๋“œ ์˜ˆ์ œ

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:

C++ Python
ย ย ย Image Recognition imagenet.cpp imagenet.py
ย ย ย Object Detection detectnet.cpp detectnet.py
ย ย ย Segmentation segnet.cpp segnet.py
ย ย ย Pose Estimation posenet.cpp posenet.py
ย ย ย Monocular Depth depthnet.cpp depthnet.py

note: for working with numpy arrays, see Converting to Numpy Arrays and Converting from Numpy Arrays

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

์ด ํ”„๋กœ์ ํŠธ๋Š” ์—ฌ๋Ÿฌ pre-trained models์ด ํ•จ๊ป˜ ์ œ๊ณต๋˜๋ฉฐ ํ•ด๋‹น ํˆด์„ ์‚ฌ์šฉํ•˜์—ฌ ๋‹ค์šด๋กœ๋“œ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Model Downloader

Image Recognition

Network CLI argument NetworkType enum
AlexNet alexnet ALEXNET
GoogleNet googlenet GOOGLENET
GoogleNet-12 googlenet-12 GOOGLENET_12
ResNet-18 resnet-18 RESNET_18
ResNet-50 resnet-50 RESNET_50
ResNet-101 resnet-101 RESNET_101
ResNet-152 resnet-152 RESNET_152
VGG-16 vgg-16 VGG-16
VGG-19 vgg-19 VGG-19
Inception-v4 inception-v4 INCEPTION_V4

Object Detection

Network CLI argument NetworkType enum Object classes
SSD-Mobilenet-v1 ssd-mobilenet-v1 SSD_MOBILENET_V1 91 (COCO classes)
SSD-Mobilenet-v2 ssd-mobilenet-v2 SSD_MOBILENET_V2 91 (COCO classes)
SSD-Inception-v2 ssd-inception-v2 SSD_INCEPTION_V2 91 (COCO classes)
DetectNet-COCO-Dog coco-dog COCO_DOG dogs
DetectNet-COCO-Bottle coco-bottle COCO_BOTTLE bottles
DetectNet-COCO-Chair coco-chair COCO_CHAIR chairs
DetectNet-COCO-Airplane coco-airplane COCO_AIRPLANE airplanes
ped-100 pednet PEDNET pedestrians
multiped-500 multiped PEDNET_MULTI pedestrians, luggage
facenet-120 facenet FACENET faces

Semantic Segmentation

Dataset Resolution CLI Argument Accuracy Jetson Nano Jetson Xavier
Cityscapes 512x256 fcn-resnet18-cityscapes-512x256 83.3% 48 FPS 480 FPS
Cityscapes 1024x512 fcn-resnet18-cityscapes-1024x512 87.3% 12 FPS 175 FPS
Cityscapes 2048x1024 fcn-resnet18-cityscapes-2048x1024 89.6% 3 FPS 47 FPS
DeepScene 576x320 fcn-resnet18-deepscene-576x320 96.4% 26 FPS 360 FPS
DeepScene 864x480 fcn-resnet18-deepscene-864x480 96.9% 14 FPS 190 FPS
Multi-Human 512x320 fcn-resnet18-mhp-512x320 86.5% 34 FPS 370 FPS
Multi-Human 640x360 fcn-resnet18-mhp-512x320 87.1% 23 FPS 325 FPS
Pascal VOC 320x320 fcn-resnet18-voc-320x320 85.9% 45 FPS 508 FPS
Pascal VOC 512x320 fcn-resnet18-voc-512x320 88.5% 34 FPS 375 FPS
SUN RGB-D 512x400 fcn-resnet18-sun-512x400 64.3% 28 FPS 340 FPS
SUN RGB-D 640x512 fcn-resnet18-sun-640x512 65.1% 17 FPS 224 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
Network CLI Argument NetworkType enum Classes
Cityscapes (2048x2048) fcn-alexnet-cityscapes-hd FCN_ALEXNET_CITYSCAPES_HD 21
Cityscapes (1024x1024) fcn-alexnet-cityscapes-sd FCN_ALEXNET_CITYSCAPES_SD 21
Pascal VOC (500x356) fcn-alexnet-pascal-voc FCN_ALEXNET_PASCAL_VOC 21
Synthia (CVPR16) fcn-alexnet-synthia-cvpr FCN_ALEXNET_SYNTHIA_CVPR 14
Synthia (Summer-HD) fcn-alexnet-synthia-summer-hd FCN_ALEXNET_SYNTHIA_SUMMER_HD 14
Synthia (Summer-SD) fcn-alexnet-synthia-summer-sd FCN_ALEXNET_SYNTHIA_SUMMER_SD 14
Aerial-FPV (1280x720) fcn-alexnet-aerial-fpv-720p FCN_ALEXNET_AERIAL_FPV_720p 2

Pose Estimation

Model CLI argument NetworkType enum Keypoints
Pose-ResNet18-Body resnet18-body RESNET18_BODY 18
Pose-ResNet18-Hand resnet18-hand RESNET18_HAND 21
Pose-DenseNet121-Body densenet121-body DENSENET121_BODY 18

๊ถŒ์žฅ ์‚ฌ์–‘

  • Jetson Nano Developer Kit with JetPack 4.2 or newer (Ubuntu 18.04 aarch64).
  • Jetson Nano 2GB Developer Kit with JetPack 4.4.1 or newer (Ubuntu 18.04 aarch64).
  • Jetson Xavier NX Developer Kit with JetPack 4.4 or newer (Ubuntu 18.04 aarch64).
  • Jetson AGX 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).

The Transfer Learning with PyTorch section of the tutorial speaks from the perspective of running PyTorch onboard Jetson for training DNNs, however the same PyTorch code can be used on a PC, server, or cloud instance with an NVIDIA discrete GPU for faster training.

์ถ”๊ฐ€

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

Two Days to a Demo (DIGITS)

note: the DIGITS/Caffe tutorial from below is deprecated. It's recommended to follow the Transfer Learning with PyTorch tutorial from Hello AI World.

Expand this section to see original DIGITS tutorial (deprecated)
The DIGITS tutorial includes training DNN's 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.

ยฉ 2016-2019 NVIDIA | Table of Contents

About

Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages