How mmm1712/esp32-cam-ai-object-tracking works
This is a prototype camera-tracking system: the ESP32-CAM streams video to a laptop, Python detects and tracks the target with YOLO, and serial movement commands drive pan/tilt servos through a second ESP32 and PCA9685. Separate Python utilities capture images and prepare labeled datasets; the README documents a custom trained model and printable, editable mount parts. The camera server and tracking script are excerpted, but the servo-controller implementation and several documented subsystems were not sampled, so their connections rely on the README.
Main entry points: app_httpd.cpp Stream Server · ai_tracking.py AI Tracking · capture_images.py Image Capture · prepare_dataset.py Dataset Preparation
Components 19
Video and Tracking
- ESP32-CAM
- Camera Startup
arduino/esp32_cam_stream/esp32_cam_stream.ino - Stream Server
arduino/esp32_cam_stream/app_httpd.cpp - Camera UI Assets
arduino/esp32_cam_stream/camera_index.h - Camera Pin Map
arduino/esp32_cam_stream/camera_pins.h - Laptop
- AI Tracking
python/ai_tracking.py - YOLO Model
models/best.pt
Dataset Preparation
- Image Capture
python/capture_images.py - Raw Images
- Target Labels
- Dataset Preparation
python/prepare_dataset.py - YOLO Dataset
Motion Hardware
- Second ESP32
arduino/servo_controller/servo_controller.ino - PCA9685 Driver
- Pan Tilt Servos
Mechanical Design
- Mount Design
openscad/camera_mount_parts.scad - Printed Parts
stl
Other components
- Operator
Connections 19
- Operator → Image Capture: captures images
python/capture_images.py - ESP32-CAM → Stream Server: supplies frames
README.md - Camera Startup → Stream Server: starts server
- Camera Startup → Camera Pin Map: configures pins
- Stream Server → Camera UI Assets: serves assets
arduino/esp32_cam_stream/app_httpd.cpp - Stream Server → Laptop: streams video
README.md - Laptop → Image Capture: runs capture
README.md - Image Capture → Raw Images: saves frames
python/capture_images.py - Operator → Target Labels: annotates images
- Raw Images → Dataset Preparation: provides images
python/prepare_dataset.py - Target Labels → Dataset Preparation: provides labels
python/prepare_dataset.py - Dataset Preparation → YOLO Dataset: writes dataset
python/prepare_dataset.py - Laptop → AI Tracking: runs tracking
README.md - Stream Server → AI Tracking: provides stream
README.md - YOLO Model → AI Tracking: loads model
python/ai_tracking.py - AI Tracking → Second ESP32: sends serial commands
README.md - Second ESP32 → PCA9685 Driver: controls over I2C
README.md - PCA9685 Driver → Pan Tilt Servos: drives servos
README.md - Mount Design → Printed Parts: defines parts
README.md