Başla

Hızlı Başlangıç Kılavuzu: Ultralytics YOLO26 ile Raspberry Pi

Raspberry Pi, gerçek zamanlı nesne algılama için uçta Ultralytics YOLO26 çalıştırabilen, GPU gerektirmeyen küçük ve uygun fiyatlı bir bilgisayardır. Bu kılavuz, işletim sistemini flaşlamaktan Ultralytics'ı yüklemeye, ARM'de en hızlı çıkarım için NCNN biçimine aktarmaya ve canlı kamera akışında tahmin çalıştırmaya kadar YOLO26'yı Raspberry Pi 4 ve 5'e dağıtma adımlarını anlatır. Ayrıca donanımına en uygun hız ve doğruluk dengesini seçebilmen için sekiz dışa aktarma biçimini kapsayan performans kıyaslamaları içerir.

Ultralytics kurulumuna, NCNN formatına dışa aktarıp çıkarım çalıştırmaya, kıyaslamalara veya kameradan çıkarıma git.



İzle: Raspberry Pi 5 güncellemeleri ve iyileştirmeleri.
Not

Bu kılavuz, en güncel Raspberry Pi OS Bookworm (Debian 12) yüklü Raspberry Pi 4 ve Raspberry Pi 5 ile test edilmiştir. Raspberry Pi 3 gibi daha eski Raspberry Pi cihazlarında da aynı Raspberry Pi OS Bookworm yüklü olduğu sürece bu kılavuzun çalışması beklenir.

Raspberry Pi nedir?#

Raspberry Pi, küçük ve uygun fiyatlı tek kartlı bir bilgisayardır. Hobi amaçlı ev otomasyonundan endüstriyel kullanımlara kadar çeşitli proje ve uygulamalarda popüler hâle gelmiştir. Raspberry Pi kartları çeşitli işletim sistemlerini çalıştırabilir ve sensörlerin, aktüatörlerin ve diğer donanım bileşenlerinin kolayca entegre edilmesini sağlayan GPIO (genel amaçlı giriş/çıkış) pinleri sunar. Farklı özelliklere sahip çeşitli modelleri vardır; ancak tümü düşük maliyetli, kompakt ve çok yönlü olma temel tasarım anlayışını paylaşır.

Raspberry Pi Serisi Karşılaştırması#

Raspberry Pi 3Raspberry Pi 4Raspberry Pi 5
CPUBroadcom BCM2837, Cortex-A53 64Bit SoCBroadcom BCM2711, Cortex-A72 64Bit SoCBroadcom BCM2712, Cortex-A76 64Bit SoC
CPU Maksimum Frekansı1.4GHz1.8GHz2.4GHz
GPUVideoCore IVVideoCore VIVideoCore VII
GPU Maksimum Frekansı400MHz500MHz800MHz
Bellek1GB LPDDR2 SDRAM1GB, 2GB, 4GB, 8GB LPDDR4-3200 SDRAM2GB, 4GB, 8GB, 16GB LPDDR4X-4267 SDRAM
PCIeUygulanamazUygulanamaz1xPCIe 2.0 arayüzü
Maksimum güç tüketimi2.5A@5V3A@5V5A@5V (PD etkin)

Raspberry Pi OS nedir?#

Raspberry Pi OS (önceden Raspbian olarak biliniyordu), Raspberry Pi Foundation tarafından dağıtılan Raspberry Pi kompakt tek kartlı bilgisayar ailesi için Debian GNU/Linux dağıtımını temel alan Unix benzeri bir işletim sistemidir. Raspberry Pi OS, ARM CPU'lu Raspberry Pi için yüksek düzeyde optimize edilmiştir ve Raspberry Pi 4 ile 5'te varsayılan olarak Wayland üzerinde çalışan hafif bir masaüstü ortamı kullanır. Raspberry Pi OS etkin olarak geliştirilmektedir; Raspberry Pi'de mümkün olduğunca çok Debian paketinin kararlılığını ve performansını iyileştirmeye odaklanır.

Raspberry Pi OS'yi Raspberry Pi'ye yükle#

Bir Raspberry Pi aldıktan sonra yapman gereken ilk şey, micro-SD karta Raspberry Pi OS'u flaşlamak, kartı cihaza takmak ve işletim sistemini başlatmaktır. Cihazını ilk kullanıma hazırlamak için Raspberry Pi'nin Başlangıç Kılavuzu belgelerini izle.

Ultralytics'i kur#

Bir sonraki Bilgisayarlı Görü projen için Ultralytics paketini Raspberry Pi'ye iki şekilde kurabilirsin:

Docker ile başla#

Raspberry Pi'de Ultralytics YOLO26'yı kullanmaya başlamanın en hızlı yolu, Raspberry Pi için önceden oluşturulmuş bir Docker imajını çalıştırmaktır.

Docker konteynerini çekip Raspberry Pi'de çalıştırmak için aşağıdaki komutu çalıştır. Bu, en yeni Debian sürümünde Python 3.13 çalıştıran resmi Python 3.13-slim imajını temel alır.

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

Docker imajında Ultralytics zaten bulunur; bu nedenle doğrudan modelini NCNN'ye aktarabilirsin.

Docker kullanmadan başla#

Ultralytics Paketini Yükle#

Burada Ultralytics paketini Raspberry Pi'ye kuracağız. NCNN gibi biçimlere aktarma bağımlılıkları, PyTorch modelini ilk kez dışa aktardığında otomatik olarak kurulur; bu nedenle burada yalnızca temel paket yeterlidir.

  1. Paket listesini güncelle, pip'i yükle ve en son sürüme yükselt

    sudo apt update
    sudo apt install python3-pip -y
    pip install -U pip
  2. ultralytics pip paketini yükle

    pip install ultralytics
  3. Cihazı yeniden başlat

    sudo reboot

Raspberry Pi'de NCNN kullan#

Ultralytics'ın desteklediği tüm model dışa aktarma biçimleri arasında NCNN, ARM gibi mobil ve gömülü platformlar için yüksek düzeyde optimize edildiğinden Raspberry Pi cihazlarında en iyi çıkarım performansını sunar. PyTorch YOLO26n modelini NCNN'ye dönüştür, ardından dışa aktarılan modelle çıkarım çalıştır:

Örnek
from ultralytics import YOLO

# YOLO26n PyTorch modelini yükle
model = YOLO("yolo26n.pt")

# # Modeli NCNN biçimine aktar
model.export(format="ncnn")  # creates 'yolo26n_ncnn_model'

# # Dışa aktarılan NCNN modelini yükle
ncnn_model = YOLO("yolo26n_ncnn_model")

# Çıkarımı çalıştır
results = ncnn_model("https://ultralytics.com/images/bus.jpg")
İpucu

Desteklenen dışa aktarma seçenekleri hakkında daha fazla bilgi için model dağıtım seçenekleri kılavuzuna bak.

YOLO26'nın YOLO11'e kıyasla performans iyileştirmeleri#

YOLO26, Raspberry Pi 5 gibi donanım kaynakları sınırlı cihazlarda çalışmak üzere özel olarak tasarlanmıştır. Raspberry Pi 5'te ONNX'e aktarılmış modellerle 640 giriş boyutunda YOLO26n, YOLO11n'ye kıyasla FPS değerini ~%15 artırırken daha yüksek mAP değerine de ulaşır (40.1'e karşı 39.5; 6.79 → 7.79). Aşağıdaki tablo ve grafik bu karşılaştırmayı gösterir.

YOLO26 benchmarks on RPi 5
Ultralytics 8.4.14 ile kıyaslama yapıldı
Performans
ModelmAP50-95(B)Çıkarım süresi (ms/im)
YOLO26n40.1128.42
YOLO26s47.8352.84
YOLO26m52.5993.78
YOLO26l54.41259.46
YOLO26x56.92636.26

Ultralytics 8.4.14 ile kıyaslandı.

Raspberry Pi 5 YOLO26 kıyaslama sonuçları#

YOLO26 kıyaslamaları, hız ve doğruluğu ölçmek için Ultralytics ekibi tarafından sekiz farklı model biçiminde gerçekleştirildi: PyTorch, TorchScript, ONNX, OpenVINO, LiteRT, MNN, NCNN, ExecuTorch. Kıyaslamalar Raspberry Pi 5'te, varsayılan 640 giriş görüntüsü boyutunda ve FP32 hassasiyetinde gerçekleştirildi.

Karşılaştırma grafiği#

Daha büyük model boyutları Raspberry Pi'de kullanışlı olamayacak kadar yavaş çalıştığından yalnızca YOLO26n ve YOLO26s modelleri yer alır.

YOLO26 benchmarks on RPi 5
Ultralytics 8.4.108 ile kıyaslama yapıldı

Ayrıntılı karşılaştırma tablosu#

Aşağıdaki tabloda Raspberry Pi 5 üzerinde çalışan iki farklı modelin (YOLO26n, YOLO26s) sekiz farklı biçimdeki (PyTorch, TorchScript, ONNX, OpenVINO, LiteRT, MNN, NCNN, ExecuTorch) kıyaslama sonuçları gösterilir. Her birleşim için durum, boyut, mAP50-95(B) metriği ve çıkarım süresi verilir.

Performans
BiçimDurumDiskteki boyut (MB)mAP50-95(B)Çıkarım süresi (ms/im)
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 ile kıyaslandı

Not

Çıkarım süresine ön/son işleme dahil değildir.

Sonuçlarımızı Yeniden Üretme#

Yukarıdaki Ultralytics kıyaslamalarını tüm dışa aktarma biçimlerinde tekrarlamak için şu kodu çalıştır:

Örnek
from ultralytics import YOLO

# YOLO26n PyTorch modelini yükle
model = YOLO("yolo26n.pt")

# COCO128 veri kümesinde YOLO26n hızını ve doğruluğunu tüm dışa aktarma formatları için kıyasla
results = model.benchmark(data="coco128.yaml", imgsz=640)

Kıyaslama sonuçlarının sistemin tam donanım ve yazılım yapılandırmasına ve kıyaslamalar çalıştırılırken sistemin mevcut iş yüküne göre değişebileceğini unutma. En güvenilir sonuçlar için çok sayıda görüntü içeren bir veri kümesi kullan; örneğin data='coco.yaml' (5000 doğrulama görüntüsü).

LiteRT dışa aktarma işlemi cihaz dışında gerçekleştirilir

format=litert dışa aktarma işlemi (litert-torch aracılığıyla) yalnızca Linux x86_64 ve macOS'ta desteklenir; Raspberry Pi'nin kendisinde desteklenmez. .tflite modelini Linux x86_64 çalışan bir makinede veya Mac'te dışa aktar, Raspberry Pi'ye kopyala ve Pi'yi çıkarım için kullan.

Raspberry Pi kamerasını kullan#

Raspberry Pi'deki bilgisayarlı görü projelerinde çıkarım için genellikle gerçek zamanlı video akışları gerekir. Raspberry Pi'deki yerleşik MIPI CSI konektörü, resmî Raspberry Pi kamera modüllerini bağlamanı sağlar. Bu kılavuzda, video akışlarını almak ve YOLO26 modelleriyle çıkarım yapmak için Raspberry Pi Camera Module 3 kullandık.

İpucu

Raspberry Pi'nin sunduğu farklı kamera modülleri ve Raspberry Pi kamera modüllerini kullanmaya nasıl başlayacağın hakkında daha fazla bilgi edin.

Not

Raspberry Pi 5, Raspberry Pi 4'ten daha küçük CSI konektörleri kullanır (22 pin - 15 pin); bu nedenle Raspberry Pi kamerası bağlamak için 15 pin - 22 pin adaptör kablosuna ihtiyacın olacak.

Kamerayı test et#

Kamerayı Raspberry Pi'ye bağladıktan sonra aşağıdaki rpicam-hello komutunu çalıştır. Kameradan yaklaşık 5 saniye boyunca canlı video akışı görmelisin.

rpicam-hello

Kamerayla çıkarım#

YOLO26 modellerinde çıkarım yapmak için Raspberry Pi Kamerasını kullanmanın iki yöntemi vardır.

Raspberry Pi kamerasıyla çıkarım yap

Kameraya erişmek ve YOLO26 modellerinde çıkarım çalıştırmak için Raspberry Pi OS ile önceden yüklenmiş olan picamera2 paketini kullan.

Örnek
import cv2
from picamera2 import Picamera2

from ultralytics import YOLO

# # Picamera2'yi başlat
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 modelini yükle
model = YOLO("yolo26n.pt")

while True:
    # # Kareleri sırayla yakala
    frame = picam2.capture_array()

    # # Kare üzerinde YOLO26 çıkarımı yap
    results = model(frame)

    # Sonuçları kare üzerinde görselleştir
    annotated_frame = results[0].plot()

    # # Sonuç karesini göster
    cv2.imshow("Camera", annotated_frame)

    # 'q' tuşuna basılırsa döngüyü sonlandır
    if cv2.waitKey(1) == ord("q"):
        break

# # Kaynakları serbest bırak ve pencereleri kapat
cv2.destroyAllWindows()

Raspberry Pi kullanırken en iyi uygulamalar#

Raspberry Pi'de YOLO26'dan en yüksek performansı almak için bu en iyi uygulamaları izle.

  1. SSD kullan

    Kesintisiz 7/24 çalışma için sistemde SSD kullan; çünkü sürekli yazma işlemleri SD kartı yıpratabilir veya bozabilir. Raspberry Pi 5'teki yerleşik PCIe konektörü sayesinde Raspberry Pi 5 için NVMe Base gibi bir adaptörle SSD bağlayabilirsin.

  2. Grafik arayüzü olmadan yazdır

    Raspberry Pi OS'yi yazdırırken masaüstü ortamını yüklememeyi (Raspberry Pi OS Lite) seçebilirsin; bu, cihazda bir miktar RAM tasarrufu sağlayarak bilgisayarlı görü işlemleri için daha fazla alan bırakır.

  3. Raspberry Pi'yi hız aşırt

    Raspberry Pi 5'te Ultralytics YOLO26 modellerini çalıştırırken performansı biraz artırmak istersen CPU'yu 2.4GHz temel hızından 3.0GHz'e, GPU'yu ise 800MHz'den 1GHz'e hız aşırtabilirsin. Sistem kararsızlaşır veya çökerse hız aşırtma değerlerini 100MHz'lik adımlarla düşür. Hız aşırtma ısı üretimini artırıp termal kısıtlamaya yol açabileceğinden uygun soğutma sağla.

    a. Yazılımı yükselt

    sudo apt update && sudo apt dist-upgrade

    b. Yapılandırma dosyasını düzenlemek için aç

    sudo nano /boot/firmware/config.txt

    c. Aşağıdaki satırları en alta ekle

    arm_freq=3000
    gpu_freq=1000
    force_turbo=1

    d. CTRL + X'e, ardından Y'ye basıp ENTER'a basarak kaydet ve çık

    e. Raspberry Pi'yi yeniden başlat

Sonraki Adımlar#

YOLO26'yı Raspberry Pi'ne başarıyla kurdun. Daha fazla bilgi için diğer çıkarım seçeneklerini görmek üzere Tahmin modunu, ek dağıtım biçimleri için Dışa aktarma modunu veya uçta daha fazla işlem gücüne ihtiyaç duyuyorsan NVIDIA Jetson kılavuzunu incele. Belgelerin tamamına Ultralytics YOLO26 Belgeleri üzerinden ulaşabilirsin.

Teşekkürler ve atıflar#

Bu kılavuz ilk olarak, nesli tehlike altındaki türlerin korunması için YOLO kullanımına adanmış bir kuruluş olan Kashmir World Foundation adına Daan Eeltink tarafından oluşturuldu. Nesne algılama teknolojileri alanındaki öncü çalışmalarını ve eğitim odaklı yaklaşımlarını takdir ediyoruz.

Kashmir World Foundation'ın faaliyetleri hakkında daha fazla bilgi için web sitesini ziyaret edebilirsin.

Sık Sorulan Sorular#

  • Ultralytics YOLO26'yı Docker kullanmadan Raspberry Pi'ye kurmak için şu adımları izle:

    1. Paket listesini güncelle ve pip aracını yükle:
      sudo apt update
      sudo apt install python3-pip -y
      pip install -U pip
    2. Ultralytics paketini yükle:
      pip install ultralytics
    3. Değişiklikleri uygulamak için cihazı yeniden başlat:
      sudo reboot

    Ayrıntılı yönergeler için Docker kullanmadan başla bölümüne bak.

  • NCNN, mobil ve gömülü platformlar için yüksek düzeyde optimize edilmiştir; bu da onu YOLO26'yı Raspberry Pi cihazlarında çalıştırmak için güçlü bir seçenek hâline getirir. ARM için optimize edilmiş çekirdekleri, Pi'de diğer dışa aktarma biçimlerinden daha hızlı çıkarım sağlar; bunu yukarıdaki kıyaslama sonuçlarında görebilirsin.

  • PyTorch YOLO26 modelini Python veya CLI komutlarını kullanarak NCNN biçimine dönüştürebilirsin:

    Örnek
    from ultralytics import YOLO
    
    # YOLO26n PyTorch modelini yükle
    model = YOLO("yolo26n.pt")
    
    # # Modeli NCNN biçimine aktar
    model.export(format="ncnn")  # creates 'yolo26n_ncnn_model'
    
    # # Dışa aktarılan NCNN modelini yükle
    ncnn_model = YOLO("yolo26n_ncnn_model")
    
    # Çıkarımı çalıştır
    results = ncnn_model("https://ultralytics.com/images/bus.jpg")

    Daha fazla bilgi için Raspberry Pi'de NCNN kullan bölümüne bak.

  • Temel farklar şunlardır:

    • CPU: Raspberry Pi 4, Broadcom BCM2711, Cortex-A72 64-bit SoC kullanırken Raspberry Pi 5, Broadcom BCM2712, Cortex-A76 64-bit SoC kullanır.
    • Maksimum CPU frekansı: Raspberry Pi 4'ün maksimum frekansı 1.8GHz iken Raspberry Pi 5'in frekansı 2.4GHz'e ulaşır.
    • Bellek: Raspberry Pi 4, 8 GB'a kadar LPDDR4-3200 SDRAM sunarken Raspberry Pi 5, 2 GB, 4 GB, 8 GB ve 16 GB seçenekleriyle LPDDR4X-4267 SDRAM sunar.

    Bu geliştirmeler, Raspberry Pi 5'teki YOLO26 modellerinin performans kıyaslamalarında Raspberry Pi 4'e kıyasla daha iyi sonuçlar elde etmesini sağlar. Daha fazla bilgi için Raspberry Pi Serisi Karşılaştırması tablosuna bak.

  • YOLO26 çıkarımı için Raspberry Pi Kamerası kurmanın iki yöntemi vardır:

    1. picamera2 kullanarak:

      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 Akışı kullanarak:

      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")

    Ayrıntılı kurulum talimatları için Kamerayla Çıkarım bölümünü ziyaret et.

Yorumlar134

Bir soru sor, sonuçlarını paylaş veya başka birine yardım et.

    1. Glenn JocherUltralytics(düzenlendi)

      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(düzenlendi)

    "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. Glenn JocherUltralytics

      Thanks for sharing the Orbit OS benchmark; for a fair cross-model comparison please include the exact export/runtime backend, imgsz, confidence/IoU thresholds, and per-image latency/FPS, since on Raspberry Pi CPU deployments NCNN is usually the best baseline for YOLO26.

    2. hm-zerooneGitHub(düzenlendi)

      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
    3. Glenn JocherUltralytics(düzenlendi)

      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(düzenlendi)

      @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?