inteintegrity2026-09-09

License Plate Recognition with Raspberry Pi 5 and Hailo-8

Detect license plates with Tiny-YOLOv4 and recognize numeric plate text with LPRNet using Hailo-8 accelerated inference on Raspberry Pi 5.

CVLicense Plate RecognitionObject DetectionGitHub

1. How It Works

This project runs a two-stage license plate pipeline on Raspberry Pi 5 with a Hailo-8 accelerator. Tiny-YOLOv4 locates each plate, then LPRNet recognizes numeric text from the original-resolution crop. Both HEF networks share one Hailo-8 through HailoRT scheduling.

LPRNet license plate recognition demo

Project Capabilities

  • Hailo-8 accelerated plate detection and OCR on Raspberry Pi 5.
  • Shared Hailo VDevice with round-robin scheduling for two HEF networks.
  • FastAPI browser preview on the local network.
  • REST image prediction with detector, quality, OCR candidate, confidence, and accepted plate fields.
  • Video, image, and camera input support.

Hardware and Software

  • Raspberry Pi 5 or a compatible CM5 system running 64-bit ARM Linux
  • Hailo-8 M.2 accelerator
  • HailoRT 4.23.x with compatible driver, firmware, library, and Python package
  • Tiny-YOLOv4 license plate detector and LPRNet HEF models
  • Python, FastAPI, Uvicorn, OpenCV, and Docker

2. Raspberry Pi 5 + Hailo-8 Deployment Guide

Clone the source repository:

bash
git clone https://github.com/Seeed-Projects/reComputer-Hailo8-CV.git
cd reComputer-Hailo8-CV

Verify the accelerator, then build the ARM64 image:

bash
hailortcli scan
hailortcli fw-control identify

sudo docker build \
  -f docker/hailo8/lprnet.dockerfile \
  -t lprnet:latest \
  src/rpi5_hailo8_lprnet

Run the application with the Hailo device and matching runtime libraries:

bash
sudo docker run --rm \
  --name rpi5-hailo8-lprnet \
  --privileged \
  --net=host \
  --device /dev/hailo0:/dev/hailo0 \
  -v /usr/lib/libhailort.so.4.23.0:/usr/lib/libhailort.so.4.23.0:ro \
  -v /usr/lib/libhailort.so:/usr/lib/libhailort.so:ro \
  lprnet:latest

Open http://<BOARD_IP>:8000 from another device on the same network. For image prediction:

bash
curl -X POST "http://<BOARD_IP>:8000/api/models/lprnet/predict" \
  -F "file=@traffic.jpg"

3. Recognition Logic and Runtime Guidance

The detector receives a 416 × 416 × 3 RGB frame and produces two raw YOLO heads. CPU post-processing applies sigmoid decoding, anchors, and NMS. LPRNet receives a 300 × 75 × 3 BGR crop and produces 5 × 19 × 11 logits, followed by mean reduction, softmax, and greedy CTC decoding.

The official recognizer uses the alphabet 0123456789-. It does not recognize letters or Chinese province characters. OCR is accepted only when the mean character confidence reaches 0.90 and at least seven digits remain after CTC collapse. A Laplacian-variance quality gate rejects blurred crops before recognition.

Runtime Recommendations

  • Keep the plate large and sharp enough in the source image.
  • Use a fixed camera and avoid strong motion blur or severe perspective distortion.
  • Keep HailoRT driver, firmware, shared library, and Python bindings compatible.
  • Adjust detector and quality thresholds with footage from the deployment site.
  • For full regional plate support, replace the recognizer and adapt the decoder while retaining the detector stage.