Autonomous Face-Tracking Drone
Overview
I built a real-time face-tracking system for a DJI Tello that recognizes a specific registered person and autonomously adjusts the drone’s motion to keep that person centered in the camera view and at a roughly constant distance. The project closes the full perception-to-action loop: camera → face recognition → image-space error → flight commands.
What I Built
The system combines four pieces implemented in Python with OpenCV, face_recognition, djitellopy, and threading: target-specific face recognition, real-time video processing, reactive three-axis flight control, and fail-safe behavior.
Perception
A reference image is encoded before takeoff. During flight, frames are downscaled to 25% resolution and face recognition runs once every 10 frames, comparing each detected encoding against the stored reference at a tolerance of 0.8 — only the registered person is used to control the drone.
Real-Time Video Pipeline
A dedicated background thread continuously reads the newest camera frame into shared memory protected by a lock, so camera acquisition, face processing, and flight control don’t block each other. This produced a smoother video stream and more responsive control on the physical drone.
Reactive Flight Control
Horizontal image error drives yaw, vertical error drives altitude, and the apparent width of the detected face (target: 170 ± 15 px) drives forward/backward motion. Commands are velocity-limited (yaw ±30, vertical ±20, forward/backward ±20).
Safety
If the registered target is lost, the drone sends zero-velocity commands and hovers rather than continuing its previous motion. A hard ceiling blocks further ascent once altitude reaches 190 cm.
Result
The completed system linked visual perception to physical UAV motion on a DJI Tello, rotating, adjusting altitude, and moving forward/backward to keep the registered face centered and at a consistent distance, and hovering safely whenever the target left the frame.
My Role
I developed the complete project: Python application architecture, DJI Tello communication, real-time face recognition, multithreaded video acquisition, three-axis reactive control, altitude and lost-target safety logic, and on-drone testing and tuning.