Spaces:
Running
Running
| title: Face Tracker | |
| emoji: π€ | |
| colorFrom: purple | |
| colorTo: blue | |
| sdk: static | |
| pinned: false | |
| short_description: "Robot smoothly follows your face" | |
| tags: | |
| - reachy_mini | |
| - reachy_mini_python_app | |
| # Face Tracker π€π€ | |
| Detects faces via MediaPipe Face Detection and smoothly tracks the closest/largest face with the robot's head. Includes proximity-based emotional responses. | |
| ## Features | |
| - **Smooth tracking**: Proportional controller with exponential smoothing | |
| - **Largest face priority**: Tracks the biggest (closest) face in frame | |
| - **Proximity emotions**: | |
| - Close (large face) β Happy, antennas up | |
| - Medium distance β Mildly content | |
| - Far (small face) β Curious | |
| - No face β Lonely drift/scanning | |
| - **Natural movement**: Smooth interpolation prevents jerky head motion | |
| - **Idle behavior**: Gentle scanning when no face detected for ~1 second | |
| ## How It Works | |
| 1. Captures frames from Reachy Mini's camera | |
| 2. Detects faces using MediaPipe Face Detection | |
| 3. Calculates face center offset from frame center | |
| 4. Maps offset to head yaw/pitch correction (proportional controller) | |
| 5. Smoothly interpolates toward target position | |
| 6. Adjusts antenna angle based on face proximity (emotion) | |
| ## Requirements | |
| - Camera connected to Reachy Mini | |
| - `mediapipe`, `opencv-python`, `numpy` | |
| ## Install & Run | |
| ```bash | |
| pip install . | |
| reachy-mini run face_tracker | |
| ``` | |