jetson-inference

dusty-nvMIT长期未更新

面向 NVIDIA Jetson 嵌入式设备的深度学习推理部署指南,用 TensorRT 加速图像识别等视觉任务,配套教程和预训练模型开箱即用。

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

model-mirror-190618发布于 2019-06-18 18:27 UTC9,036star +2 / 7 天3,118fork同步于 2026-11-10 23:32 UTC

怎么上手

由 README 提炼,执行前请确认
参见 docs/jetpack-setup-2.md 配置 JetPack;或按 docs/aux-docker.md 运行 Docker 容器;或按 docs/building-repo-2.md 从源码构建
硬件要求按 README 说明

面向 NVIDIA Jetson 设备,README 提到 JetPack 6 已支持 Orin 设备;未给出具体显存数值。

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

项目说明

由 README 自动翻译提炼

在 NVIDIA Jetson 上用 TensorRT 跑优化后的视觉 DNN 推理,并支持 PyTorch 迁移学习

面向 NVIDIA Jetson 嵌入式设备的深度学习推理部署指南,用 TensorRT 加速图像识别等视觉任务,配套教程和预训练模型开箱即用。

核心能力

  • 用 TensorRT 在 GPU 上运行优化后的网络,提供 C++ 与 Python 接口
  • 覆盖 imageNet 分类、detectNet 检测、segNet 分割、poseNet 姿态、actionNet 动作识别
  • 支持从实时摄像头流推理,并提供 WebRTC 网页应用示例
  • 支持 ROS/ROS2 的 DNN 推理节点
  • 提供 PyTorch 迁移学习流程,可采集自有数据集训练并部署

容易踩的坑

需先按文档在 Jetson 上装好 JetPack 或运行 Docker 容器,不能直接 pip 安装;预训练模型需另行下载;训练部分依赖 PyTorch,与 TensorRT 推理是两套流程。

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

最近发版

1 个版本model-mirror-190618
  1. model-mirror-190618Model Download Mirror最新正式版2019-06-18 · 2019-06-18 18:27 UTC

    This release contains mirror downloads of the DNN models used by the repo.

    During the build process, the jetson-inference repo will automatically attempt to download the models for you.

    The primary site storing the models is on Box.com. However, users from China may be unable to access Box.com, so if your system is unable to download the models from their primary location, you can grab the models that you wish to download below.

    For each model that you wish to use for inferencing at runtime, download the associated archive found below to your <jetson-inference>/data/networks directory, and then extract it with the following command:

    cd <jetson-inference>/data/networks/
    tar -zxvf <model-archive-name>.tar.gz
    

    Beforehand, clone the repo like normal. This release page is not meant for storing a version of the code.

用户点评

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

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

    README 原文

    未翻译

    Deploying Deep Learning

    Welcome to our instructional guide for inference and realtime vision DNN library for NVIDIA Jetson devices. This project uses TensorRT to run optimized networks on GPUs from C++ or Python, and PyTorch for training models.

    Supported DNN vision primitives include imageNet for image classification, detectNet for object detection, segNet for semantic segmentation, poseNet for pose estimation, and actionNet for action recognition. Examples are provided for streaming from live camera feeds, making webapps with WebRTC, and support for ROS/ROS2.

    Follow the Hello AI World tutorial for running inference and transfer learning onboard your Jetson, including collecting your own datasets, training your own models with PyTorch, and deploying them with TensorRT.

    Table of Contents

    >   JetPack 6 is now supported on Orin devices (developer.nvidia.com/jetpack) >   Check out the Generative AI and LLM tutorials on Jetson AI Lab! >   See the Change Log for the latest updates and new features.

    Hello AI World

    Hello AI World can be run completely onboard your Jetson, including live inferencing with TensorRT and transfer learning with PyTorch. For installation instructions, see System Setup. It's then recommended to start with the Inference section to familiarize yourself with the concepts, before diving into Training your own models.

    System Setup
    Inference
    Training
    WebApp Frameworks
    Appendix

    Jetson AI Lab

    The Jetson AI Lab has additional tutorials on LLMs, Vision Transformers (ViT), and Vision Language Models (VLM) that run on Orin (and in some cases Xavier). Check out some of these:

    NanoOWL - Open Vocabulary Object Detection ViT (container: nanoowl)

    Live Llava on Jetson AGX Orin (container: local_llm)

    Live Llava 2.0 - VILA + Multimodal NanoDB on Jetson Orin (container: local_llm)

    Realtime Multimodal VectorDB on NVIDIA Jetson (container: nanodb)

    Video Walkthroughs

    Below are screencasts of Hello AI World that were recorded for the Jetson AI Certification course:

    DescriptionVideo
    Hello AI World SetupDownload and run the Hello AI World container on Jetson Nano, test your camera feed, and see how to stream it over the network via RTP.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_setup.jpg width="750">
    Image Classification InferenceCode your own Python program for image classification using Jetson Nano and deep learning, then experiment with realtime classification on a live camera stream.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_imagenet.jpg width="750">
    Training Image Classification ModelsLearn how to train image classification models with PyTorch onboard Jetson Nano, and collect your own classification datasets to create custom models.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_imagenet_training.jpg width="750">
    Object Detection InferenceCode your own Python program for object detection using Jetson Nano and deep learning, then experiment with realtime detection on a live camera stream.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_detectnet.jpg width="750">
    Training Object Detection ModelsLearn how to train object detection models with PyTorch onboard Jetson Nano, and collect your own detection datasets to create custom models.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_detectnet_training.jpg width="750">
    Semantic SegmentationExperiment with fully-convolutional semantic segmentation networks on Jetson Nano, and run realtime segmentation on a live camera stream.<img src=https://github.com/dusty-nv/jetson-inference/raw/master/docs/images/thumbnail_segnet.jpg width="750">

    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
    Pose EstimationposeNetposeNet
    Action RecognitionactionNetactionNet
    Background RemovalbackgroundNetactionNet
    Monocular DepthdepthNetdepthNet
    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 images and live camera streams can be found here:

    C++Python
       Image Recognitionimagenet.cppimagenet.py
       Object Detectiondetectnet.cppdetectnet.py
       Segmentationsegnet.cppsegnet.py
       Pose Estimationposenet.cppposenet.py
       Action Recognitionactionnet.cppactionnet.py
       Background Removalbackgroundnet.cppbackgroundnet.py
       Monocular Depthdepthnet.cppdepthnet.py

    note: see the Array Interfaces section for using memory with other Python libraries (like Numpy, PyTorch, ect)

    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 to use and will be automatically downloaded:

    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
    ModelCLI 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)
    TAO PeopleNetpeoplenetPEOPLENETperson, bag, face
    TAO PeopleNet (pruned)peoplenet-prunedPEOPLENET_PRUNEDperson, bag, face
    TAO DashCamNetdashcamnetDASHCAMNETperson, car, bike, sign
    TAO TrafficCamNettrafficcamnetTRAFFICCAMNETperson, car, bike, sign
    TAO FaceDetectfacedetectFACEDETECTface
    ModelCLI argumentNetworkType enumObject 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)
    NetworkCLI ArgumentNetworkType enumClasses
    Cityscapes (2048x2048)fcn-alexnet-cityscapes-hdFCN_ALEXNET_CITYSCAPES_HD21
    Cityscapes (1024x1024)fcn-alexnet-cityscapes-sdFCN_ALEXNET_CITYSCAPES_SD21
    Pascal VOC (500x356)fcn-alexnet-pascal-vocFCN_ALEXNET_PASCAL_VOC21
    Synthia (CVPR16)fcn-alexnet-synthia-cvprFCN_ALEXNET_SYNTHIA_CVPR14
    Synthia (Summer-HD)fcn-alexnet-synthia-summer-hdFCN_ALEXNET_SYNTHIA_SUMMER_HD14
    Synthia (Summer-SD)fcn-alexnet-synthia-summer-sdFCN_ALEXNET_SYNTHIA_SUMMER_SD14
    Aerial-FPV (1280x720)fcn-alexnet-aerial-fpv-720pFCN_ALEXNET_AERIAL_FPV_720p2
    Pose Estimation
    ModelCLI argumentNetworkType enumKeypoints
    Pose-ResNet18-Bodyresnet18-bodyRESNET18_BODY18
    Pose-ResNet18-Handresnet18-handRESNET18_HAND21
    Pose-DenseNet121-Bodydensenet121-bodyDENSENET121_BODY18
    Action Recognition
    ModelCLI argumentClasses
    Action-ResNet18-Kineticsresnet181040
    Action-ResNet34-Kineticsresnet341040

    Recommended System Requirements

    • 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 Orin Nano Developer Kit with JetPack 5.0 or newer (Ubuntu 20.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 AGX Orin Developer Kit with JetPack 5.0 or newer (Ubuntu 20.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.

    Extra Resources

    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.