Drone Face Tracking
π Overview
Teach a drone to follow a face: the camera detects where the face sits in the frame, that offset is converted into movement commands, and the commands go to the drone over UDP - wherever the face goes, the drone follows.
It is usually built on the Tello educational drone (an open SDK), combining face detection, PID control, and network communication - an advanced project in human-machine interaction.
π§° What you need
- Tello educational drone (or a similar SDK-enabled model)
- Computer + camera (or the drone's own FPV feed)
- Python 3.7+ environment
- pip install: opencv-python, mediapipe or a face detection library
- A large indoor space + safety net (recommended)
π§ Step by step
Get to know the drone SDK
The Tello talks over UDP commands (take off, move, rotate)
Start by taking off and landing from SDK commands to verify the link
Face detection
Detect faces in real time from the camera (the drone's FPV feed works)
Get the face centre coordinates and the offset from the frame centre
Compute the control values
Horizontal offset becomes a left/right speed
Change in face size becomes forward/back movement (to hold distance)
Send the UDP commands
Encode the control values into Tello movement commands
Mind the command rate and the response latency
PID tuning
Run the offset through a PID loop for a smooth output
Too much gain and the drone oscillates; too little and it lags behind the target
Test safely
Start low and slow
Add a failsafe: hover or land when detection fails for longer than a threshold
π‘ Tips
- Only test indoors, in a large, wind-free space with a safety net
- Throttle the command rate (5-10 per second) so you do not flood UDP
- Hover when the face is lost - do not let the drone wander