YOLO runs at 1 frame per second on a Raspberry Pi: smaller model, size and accelerator

Use the smallest model and a smaller input size. A Pi cannot run large models in real time.

What the message means

Detection work grows with model size and image size. The CPU of a Pi has limited speed, and the camera loop may also be slow.

Fix it in this order

  1. Use the nano or small version of the model.
  2. Reduce the input size, for example to 320.
  3. Run detection every few frames and track objects in between.
  4. Use a runtime made for the CPU or an accelerator if you can.
  5. Keep the camera capture in its own thread.
  6. Move to a board with a GPU if you need real-time speed.

Why it happens

The work a detector does grows with the number of pixels it looks at, so halving the input side from 640 to 320 leaves about a quarter of the pixels. The nano and small model sizes also have far fewer parameters than the larger ones. Both changes cost some accuracy, so test with your own images.

A Raspberry Pi 4 slows its processor when it reaches about 80 °C, which is why a run that starts fast and then drops points to heat. A heat sink or fan fixes that without touching the code.

If you see this, do this

You seeDo this
About 1 fpsModel and input size.
Fast then slowsHeat. Add a heat sink.

Jetson Orin Nano vision setup, Pi under-voltage.

Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.

Why this happens

A YOLO model runs a large number of multiply-add operations for each image, and the count scales with the number of pixels. Going from a 640 by 640 input to 320 by 320 cuts the pixels from 409,600 to 102,400, which is four times fewer, and the time falls by roughly that factor if the model is compute-bound. The smaller nano models have far fewer layers and weights than the bigger ones.

A Raspberry Pi CPU also slows itself down when it is too hot or when the power supply sags. Time can be lost outside the model too, in the camera read, resizing, drawing the boxes and showing the window, so the model is not always the slow part.

How to confirm the cause

  • Time each stage with time.perf_counter: capture, resize, inference and drawing. See which one dominates.
  • Run the same image two or three times and ignore the first run, which includes start-up cost.
  • Run vcgencmd measure_temp and vcgencmd get_throttled during a run. A non-zero throttled value means under-voltage or heat limits.
  • Check the model name and the image size argument in your call.
  • Check the OS is 64-bit, and the capture resolution is not higher than needed.

Worked example

Time one inference at a reduced size. Run it twice and compare.

from ultralytics import YOLO
import time

model = YOLO("yolov8n.pt")
for _ in range(2):
    t = time.perf_counter()
    model("frame.jpg", imgsz=320, verbose=False)
    print(round((time.perf_counter() - t) * 1000), "ms")

Common mistakes

  • Timing only the first call.
  • Capturing a 1080p frame and displaying it at full size for a small model.
  • Using a larger model than the task needs.
  • Running capture and inference in one thread so the camera waits.
  • Ignoring heat and power warnings.

If this did not fix it

  • Export the model to a format with faster CPU runtimes (for example NCNN or ONNX) and compare.
  • Consider an accelerator add-on if one frame per second is still too slow.
  • Reduce how often you run detection and track objects between detections.
  • Check that nothing else is using the CPU.