빠른 시작 가이드: Ultralytics YOLO26과 Raspberry Pi

Raspberry Pi는 엣지에서 실시간 객체 감지를 수행하는 Ultralytics YOLO26을 실행할 수 있는 작고 저렴한 컴퓨터입니다. GPU는 필요하지 않습니다. 이 가이드에서는 Raspberry Pi 4 및 5에 YOLO26을 배포하는 방법을 안내합니다. 여기에는 OS 플래싱, Ultralytics 설치, ARM에서 가장 빠른 추론을 위한 NCNN 내보내기, 라이브 카메라 피드에서 예측 실행이 포함됩니다. 또한 8가지 내보내기 형식의 성능 벤치마크를 제공하므로 하드웨어에 가장 적합한 속도와 정확도 간의 균형을 선택할 수 있습니다.

Ultralytics 설정하기, NCNN으로 내보내고 추론 실행하기, 벤치마크 또는 카메라 추론으로 이동하세요.



시청: Raspberry Pi 5 업데이트 및 개선 사항.
참고

이 가이드는 최신 Raspberry Pi OS Bookworm(Debian 12)을 실행하는 Raspberry Pi 4 및 Raspberry Pi 5에서 테스트되었습니다. Raspberry Pi 3과 같은 이전 Raspberry Pi 장치에서도 동일한 Raspberry Pi OS Bookworm을 설치하면 이 가이드를 사용할 수 있을 것으로 예상됩니다.

Raspberry Pi란 무엇인가요?#

Raspberry Pi는 작고 저렴한 단일 보드 컴퓨터입니다. 취미용 홈 자동화부터 산업 분야까지 폭넓은 프로젝트와 애플리케이션에서 인기를 얻었습니다. Raspberry Pi 보드는 다양한 운영 체제를 실행할 수 있으며, 센서, 액추에이터 및 기타 하드웨어 구성 요소를 쉽게 통합할 수 있는 GPIO(범용 입출력) 핀을 제공합니다. 사양이 서로 다른 여러 모델이 있지만, 모두 저렴하고 컴팩트하며 다용도로 활용할 수 있다는 기본 설계 철학을 공유합니다.

Raspberry Pi 시리즈 비교#

Raspberry Pi 3Raspberry Pi 4Raspberry Pi 5
CPUBroadcom BCM2837, Cortex-A53 64Bit SoCBroadcom BCM2711, Cortex-A72 64Bit SoCBroadcom BCM2712, Cortex-A76 64Bit SoC
CPU 최대 주파수1.4GHz1.8GHz2.4GHz
GPUVideoCore IVVideoCore VIVideoCore VII
GPU 최대 주파수400MHz500MHz800MHz
메모리1GB LPDDR2 SDRAM1GB, 2GB, 4GB, 8GB LPDDR4-3200 SDRAM2GB, 4GB, 8GB, 16GB LPDDR4X-4267 SDRAM
PCIe해당 없음해당 없음1xPCIe 2.0 인터페이스
최대 전력 소비량2.5A@5V3A@5V5A@5V (PD 활성화)

Raspberry Pi OS란 무엇인가요?#

Raspberry Pi OS(이전 명칭 Raspbian)는 Raspberry Pi Foundation에서 배포하는 소형 단일 보드 컴퓨터 제품군인 Raspberry Pi용 Debian GNU/Linux 배포판 기반의 Unix 계열 운영 체제입니다. Raspberry Pi OS는 ARM CPU를 사용하는 Raspberry Pi에 최적화되어 있으며, Raspberry Pi 4 및 5에서 기본적으로 Wayland를 사용하는 경량 데스크톱 환경을 제공합니다. Raspberry Pi OS는 활발히 개발되고 있으며, Raspberry Pi에서 가능한 한 많은 Debian 패키지의 안정성과 성능을 개선하는 데 중점을 두고 있습니다.

Raspberry Pi OS를 Raspberry Pi에 플래시하기#

Raspberry Pi를 받은 후 가장 먼저 할 일은 micro-SD 카드에 Raspberry Pi OS를 플래싱하고, 카드를 디바이스에 삽입한 다음 OS를 부팅하는 것입니다. 첫 사용을 위한 디바이스 준비는 Raspberry Pi의 상세한 시작하기 문서를 따르세요.

Ultralytics 설정#

다음 컴퓨터 비전 프로젝트를 위해 Raspberry Pi에 Ultralytics 패키지를 설정하는 방법은 두 가지입니다.

Docker로 시작하기#

Raspberry Pi에서 Ultralytics YOLO26을 가장 빠르게 시작하는 방법은 Raspberry Pi용 사전 빌드 Docker 이미지를 실행하는 것입니다.

아래 명령을 실행하여 Docker 컨테이너를 가져온 다음 Raspberry Pi에서 실행하세요. 이 컨테이너는 최신 Debian 릴리스에서 Python 3.13을 실행하는 공식 Python 3.13-slim 이미지를 기반으로 합니다.

t=ultralytics/ultralytics:latest-arm64
sudo docker pull $t && sudo docker run -it --ipc=host $t

Docker 이미지에는 Ultralytics가 이미 포함되어 있으므로 바로 모델을 NCNN으로 내보내기를 진행할 수 있습니다.

Docker 없이 시작하기#

Ultralytics 패키지 설치#

여기서는 Raspberry Pi에 Ultralytics 패키지를 설치합니다. NCNN과 같은 형식에 필요한 내보내기 종속 항목은 PyTorch 모델을 처음 내보낼 때 자동으로 설치되므로, 여기서는 기본 패키지만 설치하면 됩니다.

  1. 패키지 목록을 업데이트하고 pip를 설치한 뒤 최신 버전으로 업그레이드합니다

    sudo apt update
    sudo apt install python3-pip -y
    pip install -U pip
  2. ultralytics pip 패키지를 설치합니다

    pip install ultralytics
  3. 장치를 재부팅합니다

    sudo reboot

Raspberry Pi에서 NCNN 사용하기#

Ultralytics가 지원하는 모든 모델 내보내기 형식 중 NCNN은 ARM과 같은 모바일 및 임베디드 플랫폼에 고도로 최적화되어 있어 Raspberry Pi 디바이스에서 가장 뛰어난 추론 성능을 제공합니다. PyTorch 형식의 YOLO26n 모델을 NCNN으로 변환한 다음, 내보낸 모델로 추론을 실행합니다.

예제
from ultralytics import YOLO

# YOLO26n PyTorch 모델 로드
model = YOLO("yolo26n.pt")

# 모델을 NCNN 형식으로 내보내기
model.export(format="ncnn")  # creates 'yolo26n_ncnn_model'

# 내보낸 NCNN 모델 불러오기
ncnn_model = YOLO("yolo26n_ncnn_model")

# 추론 실행
results = ncnn_model("https://ultralytics.com/images/bus.jpg")
팁

지원되는 내보내기 옵션에 대한 자세한 내용은 모델 배포 옵션 가이드를 참조하세요.

YOLO11 대비 YOLO26 성능 개선 사항#

YOLO26은 Raspberry Pi 5와 같이 하드웨어 리소스가 제한된 디바이스에서 실행되도록 특별히 설계되었습니다. Raspberry Pi 5에서 ONNX로 내보낸 모델과 입력 크기 640을 사용하면 YOLO26n은 YOLO11n보다 FPS가 ~15% 향상(6.79 → 7.79)되며, mAP도 더 높습니다(40.1 대 39.5). 아래 표와 차트에서 비교 결과를 확인할 수 있습니다.

YOLO26 benchmarks on RPi 5
Ultralytics 8.4.14로 벤치마크
성능
모델mAP50-95(B)추론 시간(ms/이미지)
YOLO26n40.1128.42
YOLO26s47.8352.84
YOLO26m52.5993.78
YOLO26l54.41259.46
YOLO26x56.92636.26

Ultralytics 8.4.14로 벤치마크를 수행했습니다.

Raspberry Pi 5 YOLO26 벤치마크#

Ultralytics 팀은 속도와 정확도를 측정하기 위해 8가지 모델 형식(PyTorch, TorchScript, ONNX, OpenVINO, LiteRT, MNN, NCNN, ExecuTorch)에서 YOLO26 벤치마크를 실행했습니다. 벤치마크는 Raspberry Pi 5에서 기본 입력 이미지 크기 640, FP32 정밀도로 실행했습니다.

비교 차트#

YOLO26n과 YOLO26s만 포함되어 있습니다. 더 큰 모델은 Raspberry Pi에서 실용적으로 사용하기에는 실행 속도가 너무 느립니다.

YOLO26 benchmarks on RPi 5
Ultralytics 8.4.108로 벤치마크

상세 비교 표#

아래 표는 Raspberry Pi 5에서 두 가지 모델(YOLO26n, YOLO26s)을 8가지 형식(PyTorch, TorchScript, ONNX, OpenVINO, LiteRT, MNN, NCNN, ExecuTorch)으로 실행한 벤치마크 결과를 보여줍니다. 각 조합의 상태, 크기, mAP50-95(B) 지표와 추론 시간이 포함됩니다.

성능
형식상태디스크 사용량(MB)mAP50-95(B)추론 시간(ms/이미지)
PyTorch✅5.30.4760299.09
TorchScript✅9.80.4734353.20
ONNX✅9.50.4734125.99
OpenVINO✅9.60.4734104.55
LiteRT✅9.80.4730123.30
MNN✅9.40.474991.87
NCNN✅9.40.478467.03
ExecuTorch✅9.40.4772144.83

Ultralytics 8.4.108로 벤치마크를 수행했습니다.

참고

추론 시간에는 전처리 및 후처리가 포함되지 않습니다.

결과 재현하기#

위의 Ultralytics 벤치마크를 모든 내보내기 형식에서 재현하려면 다음 코드를 실행하세요.

예제
from ultralytics import YOLO

# YOLO26n PyTorch 모델 로드
model = YOLO("yolo26n.pt")

# 모든 내보내기 형식에서 COCO128 데이터셋으로 YOLO26n의 속도와 정확도 벤치마크 수행
results = model.benchmark(data="coco128.yaml", imgsz=640)

벤치마크 결과는 시스템의 정확한 하드웨어 및 소프트웨어 구성과 벤치마크 실행 시점의 시스템 워크로드에 따라 달라질 수 있습니다. 가장 신뢰할 수 있는 결과를 얻으려면 data='coco.yaml'(검증 이미지 5000개)과 같이 이미지 수가 많은 데이터셋을 사용하세요.

LiteRT 내보내기는 기기 외부에서 실행됩니다.

format=litert 내보내기(litert-torch 사용)는 Linux x86_64 및 macOS에서만 지원되며 Raspberry Pi 자체에서는 지원되지 않습니다. Linux x86_64 머신이나 Mac에서 .tflite 모델을 내보낸 다음 Raspberry Pi로 복사하여 추론에 사용하세요.

Raspberry Pi 카메라 사용하기#

Raspberry Pi의 컴퓨터 비전 프로젝트에서는 추론을 위해 실시간 비디오 피드가 필요한 경우가 많습니다. Raspberry Pi에 내장된 MIPI CSI 커넥터를 사용하면 공식 Raspberry Pi 카메라 모듈을 연결할 수 있습니다. 이 가이드에서는 Raspberry Pi Camera Module 3을 사용해 비디오 피드를 가져오고 YOLO26 모델로 추론을 수행했습니다.

팁

Raspberry Pi에서 제공하는 다양한 카메라 모듈과 Raspberry Pi 카메라 모듈을 시작하는 방법에 대해 자세히 알아보세요.

참고

Raspberry Pi 5는 Raspberry Pi 4보다 작은 CSI 커넥터(22핀 대 15핀)를 사용하므로 Raspberry Pi 카메라를 연결하려면 15핀-22핀 어댑터 케이블이 필요합니다.

카메라 테스트#

카메라를 Raspberry Pi에 연결한 후 다음 rpicam-hello 명령을 실행합니다. 카메라의 라이브 비디오 피드가 약 5초 동안 표시됩니다.

rpicam-hello

카메라를 사용한 추론#

Raspberry Pi 카메라를 사용하여 YOLO26 모델에서 추론을 실행하는 방법은 두 가지입니다.

Raspberry Pi 카메라로 추론 실행하기

Raspberry Pi OS에 사전 설치된 picamera2을 사용해 카메라에 액세스하고 YOLO26 모델에서 추론을 실행합니다.

예제
import cv2
from picamera2 import Picamera2

from ultralytics import YOLO

# Picamera2 초기화
picam2 = Picamera2()
picam2.preview_configuration.main.size = (1280, 720)
picam2.preview_configuration.main.format = "RGB888"
picam2.preview_configuration.align()
picam2.configure("preview")
picam2.start()

# YOLO26 모델을 불러옵니다
model = YOLO("yolo26n.pt")

while True:
    # 프레임 단위로 캡처
    frame = picam2.capture_array()

    # 프레임에서 YOLO26 추론 실행
    results = model(frame)

    # 프레임에 결과를 시각화합니다
    annotated_frame = results[0].plot()

    # 결과 프레임 표시
    cv2.imshow("Camera", annotated_frame)

    # 'q'를 누르면 루프를 종료합니다
    if cv2.waitKey(1) == ord("q"):
        break

# 리소스 해제 및 창 닫기
cv2.destroyAllWindows()

Raspberry Pi 사용 시 권장 사항#

Raspberry Pi에서 YOLO26의 성능을 최대한 끌어내려면 다음 모범 사례를 따르세요.

  1. SSD 사용하기

    24시간 연속 작동을 위해 시스템에는 SSD를 사용하세요. SD 카드는 계속 쓰기 작업을 수행하면 마모되거나 고장 날 수 있습니다. Raspberry Pi 5에 내장된 PCIe 커넥터를 사용하면 Raspberry Pi 5용 NVMe Base와 같은 어댑터로 SSD를 연결할 수 있습니다.

  2. GUI 없이 플래시하기

    Raspberry Pi OS를 플래시할 때 데스크톱 환경을 설치하지 않도록 선택할 수 있습니다(Raspberry Pi OS Lite). 이렇게 하면 기기의 RAM을 절약하여 컴퓨터 비전 처리에 더 많은 메모리를 사용할 수 있습니다.

  3. Raspberry Pi 오버클럭하기

    Raspberry Pi 5에서 Ultralytics YOLO26 모델을 실행할 때 성능을 조금 더 높이고 싶다면 CPU를 기본 2.4GHz에서 3.0GHz로, GPU를 800MHz에서 1GHz로 오버클럭할 수 있습니다. 시스템이 불안정해지거나 충돌하면 오버클럭 값을 100MHz씩 낮추세요. 오버클럭은 발열을 증가시켜 열 스로틀링을 유발할 수 있으므로 적절한 냉각 장치가 설치되어 있는지 확인하세요.

    a. 소프트웨어 업그레이드하기

    sudo apt update && sudo apt dist-upgrade

    b. 설정 파일을 열어 편집하기

    sudo nano /boot/firmware/config.txt

    c. 다음 줄을 맨 아래에 추가하기

    arm_freq=3000
    gpu_freq=1000
    force_turbo=1

    d. CTRL + X를 누른 다음 Y를 누르고 ENTER를 눌러 저장하고 종료하기

    e. Raspberry Pi 재부팅하기

다음 단계#

Raspberry Pi에서 YOLO26을 성공적으로 설정했습니다. 다음 단계로 더 많은 추론 옵션을 제공하는 Predict 모드, 추가 배포 형식을 제공하는 Export 모드를 살펴보거나, 엣지에서 더 많은 연산 성능이 필요한 경우 NVIDIA Jetson 가이드를 참조하세요. 전체 문서는 Ultralytics YOLO26 문서에서 확인할 수 있습니다.

감사의 말 및 인용#

이 가이드는 멸종 위기종 보전을 위해 YOLO를 사용하는 단체인 Kashmir World Foundation의 Daan Eeltink가 처음 작성했습니다. 객체 탐지 기술 분야에서 선구적인 활동을 펼치고 교육에 중점을 둔 이들의 노력에 감사드립니다.

Kashmir World Foundation의 활동에 대한 자세한 내용은 웹사이트를 참조하세요.

자주 묻는 질문#

  • Docker 없이 Raspberry Pi에 Ultralytics YOLO26을 설정하려면 다음 단계를 따르세요.

    1. 패키지 목록을 업데이트하고 pip을 설치합니다.
      sudo apt update
      sudo apt install python3-pip -y
      pip install -U pip
    2. Ultralytics 패키지를 설치합니다.
      pip install ultralytics
    3. 변경 사항을 적용하려면 기기를 재부팅합니다.
      sudo reboot

    자세한 지침은 Docker 없이 시작하기 섹션을 참조하세요.

  • NCNN은 모바일 및 임베디드 플랫폼에 고도로 최적화되어 있어 Raspberry Pi 장치에서 YOLO26을 실행하기에 적합합니다. ARM에 최적화된 커널 덕분에 Pi에서 위 벤치마크의 다른 내보내기 형식보다 빠른 추론 속도를 제공합니다.

  • Python 또는 CLI 명령을 사용하여 PyTorch YOLO26 모델을 NCNN 형식으로 변환할 수 있습니다.

    예제
    from ultralytics import YOLO
    
    # YOLO26n PyTorch 모델 로드
    model = YOLO("yolo26n.pt")
    
    # 모델을 NCNN 형식으로 내보내기
    model.export(format="ncnn")  # creates 'yolo26n_ncnn_model'
    
    # 내보낸 NCNN 모델 불러오기
    ncnn_model = YOLO("yolo26n_ncnn_model")
    
    # 추론 실행
    results = ncnn_model("https://ultralytics.com/images/bus.jpg")

    자세한 내용은 Raspberry Pi에서 NCNN 사용하기 섹션을 참조하세요.

  • 주요 차이점은 다음과 같습니다.

    • CPU: Raspberry Pi 4는 Broadcom BCM2711, Cortex-A72 64비트 SoC를 사용하며 Raspberry Pi 5는 Broadcom BCM2712, Cortex-A76 64비트 SoC를 사용합니다.
    • 최대 CPU 주파수: Raspberry Pi 4의 최대 주파수는 1.8GHz인 반면, Raspberry Pi 5는 2.4GHz에 도달합니다.
    • 메모리: Raspberry Pi 4는 최대 8GB LPDDR4-3200 SDRAM을 제공하며, Raspberry Pi 5는 2GB, 4GB, 8GB, 16GB 구성으로 제공되는 LPDDR4X-4267 SDRAM을 탑재합니다.

    이러한 개선 사항 덕분에 Raspberry Pi 5에서 YOLO26 모델의 성능 벤치마크는 Raspberry Pi 4보다 우수합니다. 자세한 내용은 Raspberry Pi 시리즈 비교 표를 참조하세요.

  • YOLO26 추론용 Raspberry Pi Camera를 설정하는 방법은 두 가지입니다.

    1. picamera2 사용:

      import cv2
      from picamera2 import Picamera2
      
      from ultralytics import YOLO
      
      picam2 = Picamera2()
      picam2.preview_configuration.main.size = (1280, 720)
      picam2.preview_configuration.main.format = "RGB888"
      picam2.preview_configuration.align()
      picam2.configure("preview")
      picam2.start()
      
      model = YOLO("yolo26n.pt")
      
      while True:
          frame = picam2.capture_array()
          results = model(frame)
          annotated_frame = results[0].plot()
          cv2.imshow("Camera", annotated_frame)
      
          if cv2.waitKey(1) == ord("q"):
              break
      
      cv2.destroyAllWindows()
    2. TCP 스트림 사용:

      rpicam-vid -n -t 0 --inline --listen -o tcp://127.0.0.1:8888
      from ultralytics import YOLO
      
      model = YOLO("yolo26n.pt")
      results = model("tcp://127.0.0.1:8888")

    자세한 설정 방법은 카메라를 사용한 추론 섹션을 참조하세요.

댓글134

질문을 하거나 결과를 공유하거나 다른 사람을 도와주세요.

    1. Glenn JocherUltralytics(수정됨)

      Hi there!

      Thank you for your feedback and for sharing your positive experience on the Raspberry Pi 5! 😊

      Creating a tutorial for the AI kit that comes with the Raspberry Pi 5 is a fantastic idea. In the meantime, you can refer to our comprehensive Quick Start Guide for Raspberry Pi with Ultralytics YOLO26, which provides detailed instructions on setting up and running YOLO on Raspberry Pi devices, including performance benchmarks.

      For those interested in using the AI kit, the setup process should be quite similar. Here’s a quick overview to get you started:

      1. Flash Raspberry Pi OS: Ensure you have the latest Raspberry Pi OS Bookworm (Debian 12) installed. Follow the Getting Started Documentation by Raspberry Pi to prepare your device.

      2. Set Up Ultralytics:

        • With Docker:
          t=ultralytics/ultralytics:latest-arm64 && sudo docker pull $t && sudo docker run -it --ipc=host $t
        • Without Docker:
          sudo apt update
          sudo apt install python3-pip -y
          pip install -U pip
          pip install ultralytics[export]
          sudo reboot
      3. Use NCNN for Best Performance: Convert your YOLO26 model to NCNN format for optimal performance on Raspberry Pi:

        from ultralytics import YOLO
        
        # Load a YOLO26n PyTorch model
        model = YOLO("yolo26n.pt")
        
        # Export the model to NCNN format
        model.export(format="ncnn")  # creates 'yolo26n_ncnn_model'
        
        # Load the exported NCNN model
        ncnn_model = YOLO("yolo26n_ncnn_model")
        
        # Run inference
        results = ncnn_model("https://ultralytics.com/images/bus.jpg")
      4. Using the Raspberry Pi Camera: For real-time video feeds, you can use the picamera2 library or set up a TCP stream:

        • Using picamera2:

          import cv2
          from picamera2 import Picamera2
          from ultralytics import YOLO
          
          picam2 = Picamera2()
          picam2.preview_configuration.main.size = (1280, 720)
          picam2.preview_configuration.main.format = "RGB888"
          picam2.preview_configuration.align()
          picam2.configure("preview")
          picam2.start()
          
          model = YOLO("yolo26n.pt")
          
          while True:
              frame = picam2.capture_array()
              results = model(frame)
              annotated_frame = results[0].plot()
              cv2.imshow("Camera", annotated_frame)
              if cv2.waitKey(1) == ord("q"):
                  break
          
          cv2.destroyAllWindows()
        • Using TCP Stream:

          rpicam-vid -n -t 0 --inline --listen -o tcp://127.0.0.1:8888
          from ultralytics import YOLO
          
          model = YOLO("yolo26n.pt")
          results = model("tcp://127.0.0.1:8888")

      We hope this helps you get started with the AI kit on your Raspberry Pi 5. For more detailed instructions and additional resources, please visit our Raspberry Pi Guide.

      Happy coding! 🚀

  1. wnelisGitHub

    Today I've installed module ultralytics on a Raspberry Pi 4 with 4 [GiB] memory running Trixie. Some remarks about what I've learned: . Use the 64-bit variant of Raspberry OS; . Use an microSD card of at least 32 [GiB]; . Disable /tmp becoming a file system in memory (tmpfs): sudo systemctl mask tmp.mount; . OpenCV is installed using apt, module ultralytics is installed in a virtual Python environment: 'python -m venv --system-site-packages `.

    It is found that YOLO runs into a hardware error: "Illegal instruction". This can be reproduced by using the Python script shown above to export the model in NCNN format. The output is:

    Downloading https://github.com/ultralyti…: 100% ━━━━━━━━━━━━ 5.3MB 1.4MB/s 3.8s Ultralytics 8.4.191 🚀 Python-3.13.5 torch-2.14.1+cu130 CPU (aarch64) Illegal instruction

    How can this issue be solved?

    1. Paula DerrengerUltralytics

      @wnelis the most likely cause is a native PyTorch binary using instructions unsupported by the Pi 4’s CPU, rather than faulty hardware; similar crashes are documented in Ultralytics #19091 and upstream PyTorch, although your exact version is not confirmed affected. (github.com) Your log shows a CUDA build (+cu130); first replace it with the matching official CPU-only packages inside your activated virtual environment, then retry the export: (pytorch.org)

      python -m pip install --force-reinstall torch==2.14.1 torchvision==0.29.1 --index-url https://download.pytorch.org/whl/cpu

      If it still crashes, please share the text output of yolo checks and python -m pip show torch torchvision from that same environment so we can identify package/path conflicts.

  2. hm-zerooneGitHub(수정됨)

    "We haven’t validated Orbit OS yet, but if it supports tflite or onnx runtimes you should be able to deploy an exported Ultralytics YOLO26 model there using Export mode and the deployment options guide; if you try it, please share the exact device, export format, and any text error logs here in Discussions so the Ultralytics team can take a look."

    Hi @glenn-jocher,

    I added a new feature to my Orbit OS app to test YOLO models directly on edge devices, in this case a Raspberry Pi. The app now allows adding new models, and by default includes YOLO v8, v11 and v26.

    We also introduced a benchmark mode, where you can select an image and run all models to compare performance and results.

    localhost_9005_ (1)

    In the example shown in the image, YOLOv8 achieved the highest number of correct object detections by time.

    This demo video shows the remote deployment, no SSH, no Docker, of the app in action on Raspberry Pi 5 vs Arduino UNO Q and a comparison (“VS”) between the RPi 5 and UNO Q running YOLO v8. https://youtu.be/aiFJmosYVAI?si=v3Jo_TbswU3n-sZU

    1. hm-zerooneGitHub(수정됨)

      Hey! Thanks for the feedback. All models were tested under the same conditions — TFlite runtime, same image, same thresholds (conf=0.50, IoU=0.45), same imgsz 640×640 with letterbox preprocessing.

      Everything runs through the OrbitOS SDK which currently has TFLite and ONNX embedded. NCNN is something we'll look into adding in a future release.

      Quick question — for RPi deployments, would you recommend INT8 or float16 as the default export format?

      Orbit OS SDK 26.0.1 Inference example.

      Orbit OS is multi-language — For now only Go SDK is available, Python, Java and C++ SDKs are coming soon.

      image

      
      model, _ := device.AIManager.UploadAndLoadModel(
          "yolo8n",
          "models/yolo26n_float16.tflite",
          aiv26.ModelBackend_TFLITE,
          aiv26.ExecutionMode_EXEC_HIGH_THREADS,
      )
      
      resp, _ := model.Infer(ctx, tensor.Data, tensor.Shape, tensor.Dtype)
      
      fmt.Println(resp.GetOutputShape())  // [1 84 8400]
      fmt.Println(resp.GetLatencyUs())    // e.g. 528000
    2. Glenn JocherUltralytics(수정됨)

      For plain Raspberry Pi CPU deployment with LiteRT (.tflite), I’d usually default to INT8 for the best speed and memory savings, and use float16 only if quantization hurts accuracy too much or your runtime performs better with FP kernels; if you benchmark both, the LiteRT export guide is the right reference, while our Raspberry Pi guide shows NCNN as the strongest baseline once you add that backend.

      1
  3. safdarhamid64-cpuGitHub

    when i write in raspberry pi terminal : from ultralytics import yolo error msg illegal instruction pops up , i have trained model and even i have first created environment and installed pip install ultralytics but still i am not able to run model yolo11n on my Raspberry Pi 4 , Guide me plzz

    1. Glenn JocherUltralytics

      That Illegal instruction on Raspberry Pi usually means an incompatible binary wheel (most often torch/numpy pulled for the wrong arch/OS), and also note the correct import is from ultralytics import YOLO (capitalized), not yolo; please paste the text output of yolo checks plus the full traceback here in this discussion, and confirm uname -m + whether you’re on Raspberry Pi OS Bookworm 64-bit as in the Raspberry Pi YOLO26 guide; as a quick way to rule out env issues you can also try our ARM64 Docker flow from that guide:```bash t=ultralytics/ultralytics:latest-arm64 sudo docker pull $t && sudo docker run -it --ipc=host $t python -c "from ultralytics import YOLO; YOLO('yolo11n.pt')"

  4. inuropixGitHub

    Hi.. I get an error when implement botsort with reid is True and the model is ncnn(exported from yolo26n-cls.pt)

    Here’s the full traceback from the error:

        self.tracks = self.model.track(
                      ^^^^^^^^^^^^^^^^^
     File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/engine/model.py", line 579, in track
        return self.predict(source=source, stream=stream, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/engine/model.py", line 536, in predict
        return self.predictor.predict_cli(source=source) if is_cli else self.predictor(source=source, stream=stream)
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/engine/predictor.py", line 225, in __call__
        return list(self.stream_inference(source, model, *args, **kwargs))  # merge list of Results into one
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 40, in generator_context
        response = gen.send(None)
                   ^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/engine/predictor.py", line 338, in stream_inference
        self.run_callbacks("on_predict_postprocess_end")
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/engine/predictor.py", line 509, in run_callbacks
        callback(self)
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/trackers/track.py", line 93, in on_predict_postprocess_end
        tracks = tracker.update(det, result.orig_img, getattr(result, "feats", None))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/trackers/byte_tracker.py", line 361, in update
        dists = self.get_dists(unconfirmed, detections)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/trackers/bot_sort.py", line 220, in get_dists
        emb_dists = matching.embedding_distance(tracks, detections) / 2.0
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/ultralytics/trackers/utils/matching.py", line 128, in embedding_distance
        cost_matrix = np.maximum(0.0, cdist(track_features, det_features, metric))  # Normalized features
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/sbr/people_counting/lib/python3.11/site-packages/scipy/spatial/distance.py", line 2903, in cdist
        raise ValueError('XA must be a 2-dimensional array.')
    ValueError: XA must be a 2-dimensional array.

    Any idea?

    1. Glenn JocherUltralytics

      That traceback usually means BoT-SORT didn’t get valid (2D) ReID embeddings; also note that .track() should run with a Detect/Seg/Pose model, while yolo26n-cls is only meant to be the ReID feature extractor configured inside botsort.yaml (via with_reid/model). (docs.ultralytics.com)

      yolo track model=yolo26n.pt source=path/to/video.mp4 tracker="botsort.yaml"
      # in a copy of botsort.yaml
      with_reid: True
      model: yolo26n-cls.pt  # first confirm this works before swapping to an exported backend

      If you just need stable tracking on Raspberry Pi, try tracker="bytetrack.yaml" (no ReID); if you still hit this, please paste your botsort.yaml and the output of yolo checks so we can reproduce from the same environment. (docs.ultralytics.com)

  5. hananabuzainabGitHub

    I can't install ultralytics on rasspbery pi 5...with python 3.11 version,why??

    I used: pip install ultralytics

    How can i fix this problem ??

    1. Glenn JocherUltralytics

      Can you paste the full pip install ultralytics error text (as text, not a screenshot) and the output of python3 -V here so we can pinpoint what’s failing? On Raspberry Pi 5 this is most often a Python/pip mismatch or non-Bookworm/32-bit setup—please also confirm you’re on Raspberry Pi OS Bookworm 64-bit as in the Raspberry Pi with Ultralytics YOLO26 guide.

      python3 -V
      python3 -m pip install -U pip setuptools wheel
      python3 -m venv .venv
      source .venv/bin/activate
      python -m pip install -U pip
      python -m pip install ultralytics
  6. avasanjeshGitHub

    Hi,

    I want to use python version of raspberry pi 32 bit OS. can you please tell me if i can export yolo detection model in 32 bit raspberry pi?

  7. Edward-YSGitHub

    Hello,I'm wondering if there is Benchmarking Results of Two Different Models (YOLO8n, YOLO8s) Across Ten Formats: PyTorch, TF, ONNX, OpenVINO, TF SavedModel, TF GraphDef, TF Lite, PaddlePaddle, MNN, NCNN.

  8. zyt2011GitHub

    Installing a single Hailo-5 is sufficient.


    发件人: Beautifulboy111 @.> 发送时间: 2025年4月22日 14:24 收件人: ultralytics/ultralytics @.> 抄送: zyt2011 @.>; Mention @.> 主题: Re: [ultralytics/ultralytics] zh/guides/raspberry-pi/ (Discussion #19489)

    Why does my Raspberry Pi 5 have a high inference latency of 150ms when using NCNN for video recognition, even after overclocking? How can I reduce the inference time?

    ― Reply to this email directly, view it on GitHubhttps://github.com/orgs/ultralytics/discussions/19489#discussioncomment-12906311, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BJ7DFR53TAD7QVJNO3TTXJL22XOAJAVCNFSM6AAAAABYEEJCHCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEOJQGYZTCMI. You are receiving this because you were mentioned.Message ID: @.***>

    1. Glenn JocherUltralytics(수정됨)

      @Beautifulboy111 150ms inference latency with NCNN on Raspberry Pi 5 is higher than expected. Here are some steps to reduce it:

      1. Use a smaller YOLO26 model - our benchmarks show YOLO26n is significantly faster than YOLO26s with NCNN on Pi 5 (67ms vs 173ms)

      2. Reduce input resolution - try 320x320 instead of 640x640, which can cut inference time by up to 70%

      3. Optimize memory allocation by running without GUI (Raspberry Pi OS Lite)

      4. Ensure you're using proper cooling for sustained performance when overclocked

      5. Consider processing at lower FPS if your application allows it

      Regarding @zyt2011's suggestion, while accelerators like Hailo can boost performance, they're a separate investment. I'd recommend optimizing your current setup first using the techniques in our Raspberry Pi guide.

      What's your specific use case? This would help us provide more targeted optimization advice.

  9. Beautifulboy111GitHub

    Why does my Raspberry Pi 5 have a high inference latency of 150ms when using NCNN for video recognition, even after overclocking? How can I reduce the inference time?