How to Run YOLO Object Detection Models on the Raspberry Pi

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 33

  • @EdjeElectronics
    @EdjeElectronics  5 днів тому +2

    If you're using a Raspberry Pi 4, Ultralytics just released an update that will cause an error when you try to use "yolo export model=yolo11n.pt format=ncnn" at 5:15 in the video. To fix the error, run "pip install ultralytics==8.3.70 torch==2.5.1 torchvision==0.20", then re-run the command.
    I created a GitHub issue asking Ultralytics to resolve this problem, and hopefully they will address it soon. Please comment on the issue to increase visibility if you experience this error: github.com/ultralytics/ultralytics/issues/19091

  • @luisenriquevillalobosvarga426
    @luisenriquevillalobosvarga426 Годину тому +1

    Excelente video!! de los mejores que he visto hasta ahora

  • @sosome1
    @sosome1 3 дні тому +1

    Dude i am so glad you back.

  • @abdulhaqq2193
    @abdulhaqq2193 5 днів тому +2

    You're the best sir 😊

  • @PixlPainter_
    @PixlPainter_ 6 днів тому +1

    Thanks a lot for your effort!

  • @kessbeats603
    @kessbeats603 6 днів тому +1

    Genius as always!

  • @amarachicyprian2262
    @amarachicyprian2262 6 днів тому +1

    going to try this today!

    • @EdjeElectronics
      @EdjeElectronics  5 днів тому

      Great! Let me know if you have any issues getting it to work 👍

    • @amarachicyprian2262
      @amarachicyprian2262 5 днів тому

      yolo export model=my_model.pt format=ncnn
      Ultralytics 8.3.71 Ÿš€ Python-3.11.2 torch-2.6.0+cpu CPU (Cortex-A72)
      YOLO11n summary (fused): 238 layers, 2,583,127 parameters, 0 gradients, 6.3 GFLOPs
      PyTorch: starting from 'my_model.pt' with input shape (1, 3, 480, 480) BCHW and output shape(s) (1, 9, 4725) (5.2 MB)
      TorchScript: starting export with torch 2.6.0+cpu...
      Illegal instruction

    • @amarachicyprian2262
      @amarachicyprian2262 5 днів тому

      for more context i'm using a debian GNU/Linux 12 (bookworm) os and a raspberry pi4b (arm64)

    • @EdjeElectronics
      @EdjeElectronics  5 днів тому +1

      @amarachicyprian2262 ahh bummer. Thank you for posting the full error, that's helpful. You aren't the only one to encounter this issue. I'm not able to reproduce the error on my Pi 4, but it may have to do with the Ultralytics version - the version for my trained custom model is Ultralytics 8.3.67, and it works. I'll look into it!

    • @EdjeElectronics
      @EdjeElectronics  5 днів тому +1

      Sigh, yep, they broke it. The latest version of Ultralytics causes the "yolo export model=my_model.pt format=ncnn" command to error out. Man it's rough trying to create these guides when versions are always changing 😢. Anyway, you can fix it by using "pip install ultralytics==8.3.70 torch==2.5.1 torchvision==0.20" and then re-running the export command.

  • @Arnegamer
    @Arnegamer 5 днів тому +2

    I can't do the command you did at 5:15. Torchscript says starting export with torch 2.6.0+cpu... Invalid instruction.

    • @EdjeElectronics
      @EdjeElectronics  5 днів тому

      Hmm... What model and OS of Raspberry Pi are you using? And are you using the yolo11n.pt model or something else? As a general troubleshooting step, try restarting with a fresh installation of Raspberry Pi OS and working through the steps again.

    • @EdjeElectronics
      @EdjeElectronics  5 днів тому +1

      It's a problem with the latest version of Ultralytics and PyTorch. You can fix it by running "pip install ultralytics==8.3.70 torch==2.5.1 torchvision==0.20" and then running the export command again.

  • @hampushillding9892
    @hampushillding9892 4 дні тому +1

    I'm using a Rapberry Pi Camera module 3. When i run your script with --source==picamera0 i don't get a window showing the camera view. Is this expected? How can I show what the camera sees? I'm not getting any error messages it just does seemingly nothing.
    Thank you in advance! You're videos amazing!

  • @LagGamers143
    @LagGamers143 4 години тому

    i have a yolo8 model which is trained on the custom dataset of grocery items , the model size is around 130mb will it run on pi 4?

  • @wlosienica1738
    @wlosienica1738 Годину тому

    Hi. I have an issue where I have an errror code coming up when I try to install the ultralytics “getting requirements to build wheel” did not run successfully.. I hope you can help

  • @bogart2352
    @bogart2352 4 дні тому

    How did you get the coordinates of the couch?

  • @CARdibia
    @CARdibia 6 днів тому +1

    Can you integrate SMS feature to the YOLO model when it has detected an object, let's say "banana"

  • @mortysmith2192
    @mortysmith2192 6 днів тому +1

    Can you show how to do it on the Google coral ?

    • @EdjeElectronics
      @EdjeElectronics  6 днів тому

      No, the Coral is a bit obsolete now, so I don't use it anymore. If you're still interested, you can find instructions on how to use it here: docs.ultralytics.com/guides/coral-edge-tpu-on-raspberry-pi/ .

    • @mortysmith2192
      @mortysmith2192 6 днів тому

      @ Yh I’ve checked it out and there guide doesn’t provide nearly enough needed to get it working, desperately needed it for a project I’m working on in university to get up the frame rate but haven’t been able to find good information for good integration with yolo

  • @FernandoLopez-pp3it
    @FernandoLopez-pp3it 5 днів тому

    Excelent video mate, everything works perfectly. Only I have one question, I am using rapsberry pi 4 since I need to use ROS Noetic 1 (Raspberry pi 5 use ROS 2) but the resolution, which I reduce to 640x480, is about 2 fps and it looks a little slow. Do you know how can I improve the fps for the detecion? Or do you know for example how to run this using the TPU coral accelerator from google? Thanks!

    • @amarachicyprian2262
      @amarachicyprian2262 5 днів тому

      @@FernandoLopez-pp3it hey! do you have any idea what your pi4 os is? also the python version you’re using? i have a problem with turning the model into an ncnn format and i’m not sure what the problem is

    • @FernandoLopez-pp3it
      @FernandoLopez-pp3it 4 дні тому

      @amarachicyprian2262 For sure, the python version I dont remeber well if it is python 3.8 or python 3.10 and the OS is Ubuntu 20.04 Budgie

  • @Techpronet-wy8ro
    @Techpronet-wy8ro День тому

    How can I contact you. I have some questions I would like ask you. More like your opinion on something

  • @sherlockholmes3567
    @sherlockholmes3567 День тому

    hey does this work offline