This repository hosts the implementation necessary to establish a multi-camera object detection system leveraging the power of ESP32-CAMs and a Raspberry Pi. The system captures video streams from ESP32-CAM modules and applies object detection using TensorFlow Lite, demonstrating a foundational approach to integrating edge devices with AI capabilities.
Ensure the Raspberry Pi is connected to the internet and have terminal access. The setup assumes it's a fresh installation of Raspberry Pi OS and the ESP32-CAM modules ready and accessible within the same network.
-
System Update and Dependencies Installation
updating and installing necessary packages:
sudo apt update && sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
-
Python 3.9 Installation
Compile and install Python 3.9 on Raspberry Pi to ensure compatibility with TensorFlow Lite and other dependencies:
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz tar xf Python-3.9.0.tar.xz cd Python-3.9.0 ./configure --enable-optimizations --prefix=/usr make -j $(nproc) # Utilizes all available cores for compilation sudo make altinstall
Verify the installation:
python3.9 --version
-
Virtual Environment Preparation
Setting up a Python virtual environment isolates the project dependencies and avoids conflicts with system packages:
python3.9 -m venv tflite source tflite/bin/activate
-
Environment Configuration
Properly configure the environment to connect to the ESP32-CAM modules:
echo "ESP32_CAM_IP=<ESP32-CAM IP Address>" > .env
Replace
<ESP32-CAM IP Address>
with the actual IP address of ESP32-CAM. -
Application Execution
-
Basic Video Streaming:
To verify the basic video stream functionality from the ESP32-CAM, execute:
python3 basic.py
-
Object Detection:
To run the object detection on the video stream:
python3 detection.py
-
This project is distributed under the Apache License 2.0, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
To cite this in your projects, please use the following BibTeX entry, and refer to the Zenodo badge above for the most current DOI:
@software{dhruba_2024_10730004,
author = {Dhruba, Saha},
title = {Multi-Camera Object Detection System},
month = mar,
year = 2024,
publisher = {Zenodo},
doi = {10.5281/zenodo.10730004},
url = {https://doi.org/10.5281/zenodo.10730004}
}