Meet YOLO26: next-gen vision AI.

Link to this sectionNVIDIA Jetson에서 DeepStream SDK와 TensorRT를 활용한 Ultralytics YOLO26#



Watch: How to use Ultralytics YOLO26 models with NVIDIA Deepstream on Jetson Orin NX 🚀

본 종합 가이드는 NVIDIA Jetson 장치에서 DeepStream SDK와 TensorRT를 사용하여 Ultralytics YOLO26을 배포하는 방법에 대한 자세한 단계별 안내를 제공합니다. 여기서는 Jetson 플랫폼에서 추론 성능을 극대화하기 위해 TensorRT를 사용합니다.

NVIDIA DeepStream SDK on Jetson platform
참고

This guide has been tested with NVIDIA Jetson Orin Nano Super Developer Kit running the latest stable JetPack release of JP6.1, Seeed Studio reComputer J4012 which is based on NVIDIA Jetson Orin NX 16GB running JetPack release of JP5.1.3 and Seeed Studio reComputer J1020 v2 which is based on NVIDIA Jetson Nano 4GB running JetPack release of JP4.6.4. It is expected to work across all the NVIDIA Jetson hardware lineup including latest and legacy.

Link to this sectionNVIDIA DeepStream이란 무엇입니까?#

NVIDIA's DeepStream SDK is a complete streaming analytics toolkit based on GStreamer for AI-based multi-sensor processing, video, audio, and image understanding. It's ideal for vision AI developers, software partners, startups, and OEMs building IVA (Intelligent Video Analytics) apps and services. You can now create stream-processing pipelines that incorporate neural networks and other complex processing tasks like tracking, video encoding/decoding, and video rendering. These pipelines enable real-time analytics on video, image, and sensor data. DeepStream's multi-platform support gives you a faster, easier way to develop vision AI applications and services on-premise, at the edge, and in the cloud.

Link to this section사전 요구 사항#

본 가이드를 시작하기 전에:

본 가이드에서는 Jetson 장치에 DeepStream SDK를 설치하는 Debian 패키지 방식을 사용했습니다. 이전 버전의 DeepStream에 액세스하려면 DeepStream SDK on Jetson (Archived) 페이지를 방문할 수도 있습니다.

Link to this sectionYOLO26을 위한 DeepStream 구성#

여기서는 YOLO 모델에 대한 NVIDIA DeepStream SDK 지원을 포함하는 marcoslucianops/DeepStream-Yolo GitHub 리포지토리를 사용합니다. 기여해주신 marcoslucianops의 노력에 감사드립니다!

  1. 필요한 종속성과 함께 Ultralytics 설치

    cd ~
    pip install -U pip
    git clone https://github.com/ultralytics/ultralytics
    cd ultralytics
    pip install -e ".[export]" onnxslim
  2. DeepStream-Yolo 리포지토리 복제

    cd ~
    git clone https://github.com/marcoslucianops/DeepStream-Yolo
  3. Copy the export_yolo26.py file from DeepStream-Yolo/utils directory to the ultralytics folder

    cp ~/DeepStream-Yolo/utils/export_yolo26.py ~/ultralytics
    cd ultralytics
  4. YOLO26 릴리스에서 원하는 Ultralytics YOLO26 감지 모델(.pt)을 다운로드하십시오. 여기서는 yolo26s.pt를 사용합니다.

    wget https://github.com/ultralytics/assets/releases/download/v8.4.0/yolo26s.pt
참고

사용자 지정 학습된 YOLO26 모델을 사용할 수도 있습니다.

  1. 모델을 ONNX로 변환

    python3 export_yolo26.py -w yolo26s.pt
위 명령에 아래 인수를 전달하십시오.

DeepStream 5.1의 경우 --dynamic 인수를 제거하고 opset 12 이하를 사용하십시오. 기본 opset은 17입니다.

--opset 12

추론 크기 변경 (기본값: 640)

-s SIZE
--size SIZE
-s HEIGHT WIDTH
--size HEIGHT WIDTH

1280에 대한 예시:

-s 1280
or
-s 1280 1280

ONNX 모델 단순화 (DeepStream >= 6.0)

--simplify

동적 배치 크기 사용 (DeepStream >= 6.1)

--dynamic

정적 배치 크기 사용 (배치 크기 = 4에 대한 예시)

--batch 4
  1. 생성된 .onnx 모델 파일과 labels.txt 파일을 DeepStream-Yolo 폴더로 복사

    cp yolo26s.pt.onnx labels.txt ~/DeepStream-Yolo
    cd ~/DeepStream-Yolo
  2. 설치된 JetPack 버전에 따라 CUDA 버전 설정

    JetPack 4.6.4의 경우:

    export CUDA_VER=10.2

    JetPack 5.1.3의 경우:

    export CUDA_VER=11.4

    JetPack 6.1의 경우:

    export CUDA_VER=12.6
  3. 라이브러리 컴파일

    make -C nvdsinfer_custom_impl_Yolo clean && make -C nvdsinfer_custom_impl_Yolo
  4. 모델에 따라 config_infer_primary_yolo26.txt 파일 편집 (80개 클래스를 사용하는 YOLO26s의 경우)

    [property]
    ...
    onnx-file=yolo26s.pt.onnx
    ...
    num-detected-classes=80
    ...
  5. deepstream_app_config 파일 편집

    ...
    [primary-gie]
    ...
    config-file=config_infer_primary_yolo26.txt
  6. deepstream_app_config 파일에서 비디오 소스를 변경할 수도 있습니다. 여기서는 기본 비디오 파일이 로드됩니다.

    ...
    [source0]
    ...
    uri=file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

Link to this section추론 실행#

deepstream-app -c deepstream_app_config.txt
참고

추론을 시작하기 전에 TensorRT 엔진 파일을 생성하는 데 시간이 오래 걸립니다. 잠시 기다려 주십시오.

YOLO26 with deepstream

If you want to convert the model to FP16 precision, simply set model-engine-file=model_b1_gpu0_fp16.engine and network-mode=2 inside config_infer_primary_yolo26.txt

Link to this sectionINT8 보정#

추론에 INT8 정밀도를 사용하려면 아래 단계를 따라야 합니다:

참고

현재 INT8은 TensorRT 10.x에서 작동하지 않습니다. 본 가이드의 이 섹션은 TensorRT 8.x에서 테스트되었으며 해당 버전에서 작동할 것으로 예상됩니다.

  1. OPENCV 환경 변수 설정

    export OPENCV=1
  2. 라이브러리 컴파일

    make -C nvdsinfer_custom_impl_Yolo clean && make -C nvdsinfer_custom_impl_Yolo
  3. COCO 데이터세트의 경우 val2017을 다운로드하고 압축을 푼 뒤 DeepStream-Yolo 폴더로 이동하십시오.

  4. 보정 이미지를 위한 새 디렉터리 생성

    mkdir calibration
  5. 다음 명령을 실행하여 COCO 데이터세트에서 무작위 이미지 1000개를 선택하여 보정을 실행하십시오.

    for jpg in $(ls -1 val2017/*.jpg | sort -R | head -1000); do
      cp ${jpg} calibration/
    done
참고

NVIDIA는 우수한 정확도를 위해 최소 500개의 이미지를 권장합니다. 이 예제에서는 더 나은 정확도를 위해 1000개의 이미지를 선택했습니다 (이미지가 많을수록 정확도가 높아짐). head -1000에서 이를 설정할 수 있습니다. 예를 들어 2000개의 이미지를 원할 경우 head -2000을 사용하십시오. 이 과정은 시간이 오래 걸릴 수 있습니다.

  1. 선택된 모든 이미지를 포함하는 calibration.txt 파일 생성

    realpath calibration/*jpg > calibration.txt
  2. 환경 변수 설정

    export INT8_CALIB_IMG_PATH=calibration.txt
    export INT8_CALIB_BATCH_SIZE=1
참고

INT8_CALIB_BATCH_SIZE 값이 높을수록 정확도가 향상되고 보정 속도가 빨라집니다. GPU 메모리에 맞춰 설정하십시오.

  1. config_infer_primary_yolo26.txt 파일 업데이트

    기존

    ...
    model-engine-file=model_b1_gpu0_fp32.engine
    #int8-calib-file=calib.table
    ...
    network-mode=0
    ...

    변경

    ...
    model-engine-file=model_b1_gpu0_int8.engine
    int8-calib-file=calib.table
    ...
    network-mode=1
    ...

Link to this section추론 실행#

deepstream-app -c deepstream_app_config.txt

Link to this section멀티 스트림 설정#



Watch: How to Run Multi-Stream Inference with Ultralytics YOLO26 using NVIDIA DeepStream on Jetson Orin 🚀

단일 DeepStream 애플리케이션에서 여러 스트림을 설정하려면 deepstream_app_config.txt 파일에 다음과 같이 변경하십시오:

  1. 원하는 스트림 수에 맞춰 격자 디스플레이를 구성할 행과 열을 변경하십시오. 예를 들어, 4개의 스트림의 경우 2행 2열을 추가할 수 있습니다.

    [tiled-display]
    rows=2
    columns=2
  2. num-sources=4로 설정하고 4개 스트림 모두에 대한 uri 항목을 추가하십시오.

    [source0]
    enable=1
    type=3
    uri=path/to/video1.jpg
    uri=path/to/video2.jpg
    uri=path/to/video3.jpg
    uri=path/to/video4.jpg
    num-sources=4

Link to this section추론 실행#

deepstream-app -c deepstream_app_config.txt
DeepStream multi-camera streaming configuration

Link to this section벤치마크 결과#

다음 벤치마크는 NVIDIA Jetson Orin NX 16GB에서 640x640 입력 크기로 각기 다른 TensorRT 정밀도 수준에서 YOLO26 모델이 어떻게 성능을 발휘하는지 요약합니다.

Link to this section비교 차트#

NVIDIA Jetson DeepStream performance benchmarks

Link to this section상세 비교 표#

성능
형식상태추론 시간(ms/im)
TensorRT (FP32)8.64
TensorRT (FP16)5.27
TensorRT (INT8)4.54

Link to this section감사의 말#

본 가이드는 Seeed Studio의 Lakshantha와 Elaine이 초기 작성하였습니다.

Link to this sectionFAQ#

Link to this sectionNVIDIA Jetson 장치에서 Ultralytics YOLO26을 어떻게 설정합니까?#

To set up Ultralytics YOLO26 on an NVIDIA Jetson device, you first need to install the DeepStream SDK compatible with your JetPack version. Follow the step-by-step guide in our Quick Start Guide to configure your NVIDIA Jetson for YOLO26 deployment.

Link to this sectionNVIDIA Jetson에서 YOLO26과 함께 TensorRT를 사용하는 이점은 무엇입니까?#

YOLO26과 TensorRT를 함께 사용하면 추론을 위해 모델이 최적화되어 NVIDIA Jetson 장치에서 대기 시간이 크게 단축되고 처리량이 향상됩니다. TensorRT는 레이어 퓨전, 정밀도 보정 및 커널 자동 튜닝을 통해 고성능, 저지연 딥러닝 추론을 제공합니다. 이는 더 빠르고 효율적인 실행으로 이어지며, 비디오 분석 및 자율 머신과 같은 실시간 애플리케이션에 특히 유용합니다.

Link to this section서로 다른 NVIDIA Jetson 하드웨어에서 DeepStream SDK와 함께 Ultralytics YOLO26을 실행할 수 있습니까?#

네, DeepStream SDK와 TensorRT를 사용하여 Ultralytics YOLO26을 배포하는 가이드는 전체 NVIDIA Jetson 라인업과 호환됩니다. 여기에는 JetPack 5.1.3을 사용하는 Jetson Orin NX 16GB와 JetPack 4.6.4를 사용하는 Jetson Nano 4GB와 같은 장치가 포함됩니다. 자세한 단계는 YOLO26을 위한 DeepStream 구성 섹션을 참조하십시오.

Link to this sectionDeepStream을 위해 YOLO26 모델을 어떻게 ONNX로 변환할 수 있습니까?#

To convert a YOLO26 model to ONNX format for deployment with DeepStream, use the utils/export_yolo26.py script from the DeepStream-Yolo repository.

명령어 예시는 다음과 같습니다:

python3 utils/export_yolo26.py -w yolo26s.pt --opset 12 --simplify

모델 변환에 대한 자세한 내용은 모델 내보내기 섹션을 확인하십시오.

Link to this sectionNVIDIA Jetson Orin NX에서의 YOLO 성능 벤치마크는 어떻습니까?#

NVIDIA Jetson Orin NX 16GB에서의 YOLO26 모델 성능은 TensorRT 정밀도 수준에 따라 다릅니다. 예를 들어, YOLO26s 모델은 다음을 달성합니다:

  • FP32 정밀도: 14.6 ms/im, 68.5 FPS
  • FP16 정밀도: 7.94 ms/im, 126 FPS
  • INT8 정밀도: 5.95 ms/im, 168 FPS

이 벤치마크는 NVIDIA Jetson 하드웨어에서 TensorRT로 최적화된 YOLO26 모델을 사용하는 것의 효율성과 성능을 잘 보여줍니다. 자세한 내용은 벤치마크 결과 섹션을 참조하십시오.

댓글