Obstacle Avoidance Car with Monocular Depth Estimation
A graduation project autonomous car that steers using real-time monocular depth estimation running on a Raspberry Pi.
Project Overview
My bachelor’s graduation project — titled “Deep Learning and Its Application” — an autonomous four-wheel-drive car that determines its driving direction purely from a single camera feed, using the MiDaS monocular depth estimation model to infer scene depth without stereo cameras or LiDAR.
Car Source Code | MiDaS C++ Inference Example | Thesis (Turkish) | Demo Video

Technical Details
- The MiDaS v2.1-small depth estimation model — run through TensorFlow Lite and OpenCV, entirely in C++ — processes the live camera feed to produce a depth map.
- A simple detection algorithm extracts a layer of that depth estimation into a binary image, then decides whether to steer left or right by analyzing the distribution of pixels across it.
- The model and control algorithms run on a Raspberry Pi 4 as the onboard single-board computer, with an Arduino handling low-level hardware control (motors and steering).
- Combines Python (for AI model inference) and C++ (for hardware control and the final MiDaS deployment) in a single pipeline.
Results
Benchmarked on a Raspberry Pi 4 Model B (4 GB RAM, 64-bit Ubuntu 22.04, no overclocking): roughly 2.3 FPS using all cores, and 0.91 FPS single-threaded.

Outcome
The project was well received by my thesis instructor as a demonstration of practical, real-time AI deployment on constrained embedded hardware.