Skip to main content

Real-Time Object Detection on Raspberry Pi

Run YOLO object detection models on edge devices with OpenCV camera integration, MQTT messaging, and Docker deployment support.

Quick Start

Get YOLO-Pi running on your Raspberry Pi in minutes

1

Clone and setup the repository

Clone the YOLO-Pi repository and navigate to the source directory.
git clone https://github.com/CiscoBlockChain/YOLO-Pi.git
cd YOLO-Pi/src
2

Download pre-trained YOLO model

Download the tiny-yolo-voc weights and configuration from the official YOLO website, then convert to Keras format.
./yad2k.py tiny-yolo-voc.cfg tiny-yolo-voc.weights model_data/tiny-yolo-voc.h5
The tiny-yolo-voc model is recommended for Raspberry Pi as it provides a good balance between speed and accuracy.
3

Configure your model paths

Edit the model configuration in yolo-pi.py to specify your model paths.
model_path = 'model_data/tiny-yolo-voc.h5'
anchors_path = 'model_data/tiny-yolo-voc_anchors.txt'
classes_path = 'model_data/pascal_classes.txt'
4

Run object detection

Start real-time object detection from your USB camera.
python3 yolo-pi.py
The system will process frames at approximately 0.5 FPS on Raspberry Pi 3, detecting objects and publishing results via MQTT.

Key Features

Everything you need for edge AI object detection

Real-Time Detection

Process live camera feeds with YOLO v2 models optimized for Raspberry Pi hardware

Model Conversion

Convert YOLO weights to Keras format using the integrated yad2k toolkit

Docker Support

Pre-built Docker images for both x86 and ARM architectures with all dependencies

MQTT Integration

Publish detection results to MQTT broker for IoT integration and monitoring

Pre-trained Models

Support for COCO and Pascal VOC datasets with 20+ object classes

OpenCV Integration

Native OpenCV 3 camera support for USB and Raspberry Pi Camera Module

Ready to Start Detecting Objects?

Follow our comprehensive guide to set up YOLO-Pi on your Raspberry Pi and start detecting objects in real-time.

View Quickstart Guide