Optimize Raspberry Pi Vision Pipeline

Замовник: AI | Опубліковано: 20.12.2025
Бюджет: 250 $

My current Python-OpenCV pipeline on a Raspberry Pi 4 maxes out at 95 % CPU while running MobileNet-SSD object detection and pushing an RTSP feed. I need that load under 60 % without sacrificing the video quality. Efficient RTSP streaming is the top priority, and I want the camera feed to stay rock-solid at 1080p for higher resolution viewing. What has to happen: • Restructure the video pipeline so FFmpeg (or MediaMTX) handles RTSP efficiently, keeping latency low while sustaining full-HD frames. • Convert the Caffe MobileNet-SSD model to TensorFlow Lite, then thread or async the inference loop so it sits comfortably beside the streaming process. • Split CPU-heavy sections into separate threads or asyncio tasks, making sure OpenCV frame handling, model inference, UDP alerting, and CSV/SQLite logging never block one another. • Tighten UDP communications and ensure logs write cleanly to SQLite without bottlenecks. • Embed lightweight performance monitoring: CPU, memory, FPS, and stream health metrics exposed through an endpoint or CLI readout for quick checks. Acceptance criteria: 1. Side-by-side benchmarks showing pre-optimization (≈95 % CPU, variable FPS) versus post-optimization (< 60 % CPU, stable 1080p stream, equal or higher FPS). 2. End-to-end Docker image that boots on a clean Pi 4, automatically launches the service, and exposes the RTSP URL. 3. Clear documentation of every optimization, commands to rebuild the container, and instructions for redeploying models. Hand me back modular, well-commented Python code, the benchmark results, the Dockerfile/image, and the docs so I can drop the container onto any Pi 4 and hit the ground running.