Overview
YOLO-Pi requires several Python packages and system libraries to run. The installation process involves setting up Python 3, OpenCV 3, and deep learning frameworks (Keras and TensorFlow).Prerequisites
Python 3 Installation
YOLO-Pi requires Python 3. We recommend using Anaconda for better package management:After installation, create a new environment:
OpenCV 3 Installation
OpenCV 3.0.0 is required for video capture and image processing. Version 3.1 has known bugs on macOS that cause crashes.Using Conda (Recommended for macOS):Building from Source:If you need to build OpenCV 3.3.0 from source (required for Raspberry Pi), see the Docker setup instructions for the complete build configuration.
This installs OpenCV 3.0.0, which is more stable than 3.1.1 on macOS systems.
Deep Learning Libraries
Install Keras, TensorFlow, and supporting libraries:Using pip:For conda users:
NumPy is typically pre-installed with Anaconda, but can be installed separately if needed.
Required Dependencies Summary
| Package | Version | Notes |
|---|---|---|
| Python | 3.x | We use Python 3.6 |
| OpenCV | 3.0.0 | Version 3.1 crashes on macOS |
| Keras | 2.1.2 | Deep learning framework |
| TensorFlow | 1.1.0 | Backend for Keras |
| Pillow | 4.3.0 | Image processing |
| NumPy | Latest | Numerical computing |
| h5py | 2.7.1 | Model file format support |
| paho-mqtt | Latest | Optional: MQTT publishing |
Setting Up YOLO Models
After installing dependencies, you’ll need to prepare the YOLO model files:Download YOLO Weights and Config
Download the Tiny YOLO VOC weights and configuration from the official YOLO website:
Convert to Keras Format
Use the YAD2K tool to convert YOLO weights to Keras format:This creates the
tiny-yolo-voc.h5 file needed by YOLO-Pi.Verification
Test your installation by running the YOLO-Pi script:On a MacBook Pro, expect approximately 1 frame every 2 seconds. Performance varies based on hardware.
Troubleshooting
ImportError: No module named cv2
ImportError: No module named cv2
OpenCV is not properly installed. Reinstall using conda:
OpenCV crashes on macOS
OpenCV crashes on macOS
You may be using OpenCV 3.1, which has known issues. Downgrade to 3.0.0:
Keras/TensorFlow version conflicts
Keras/TensorFlow version conflicts
Ensure you’re using the exact versions specified:
Next Steps
Raspberry Pi Setup
Configure YOLO-Pi on Raspberry Pi 3 with camera support
Docker Setup
Run YOLO-Pi in a Docker container for easier deployment

