An open API service indexing awesome lists of open source software.

https://github.com/AkinduID/FazeTrak

EyeRiz is a smart webcam capable of face recognition, gesture-based face locking, tracking, and release the lock, developed For the CS3283 - Embedded Systems Project in Semester 5.
https://github.com/AkinduID/FazeTrak

arduino computer-vision cplusplus face-detection gesture-recognition mediapipe opencv pyqt5 python

Last synced: 6 months ago
JSON representation

EyeRiz is a smart webcam capable of face recognition, gesture-based face locking, tracking, and release the lock, developed For the CS3283 - Embedded Systems Project in Semester 5.

Awesome Lists containing this project

README

          

# FazeTrak








**Smart face-tracking webcam system with gesture control and ESP32-C3 servo integration**

---

## πŸ“‹ Table of Contents

- [Overview](#overview)
- [Features](#features)
- [Project Structure](#project-structure)
- [Hardware Requirements](#hardware-requirements)
- [Software Requirements](#software-requirements)
- [Installation](#installation)
- [Usage](#usage)
- [System Architecture](#system-architecture)
- [Documentation](#documentation)
- [Contributing](#contributing)

---

## 🎯 Overview

FazeTrak is an intelligent webcam system capable of real-time face detection, gesture-based control, and autonomous tracking. Developed for **CS3283 - Embedded Systems Project (Semester 5)**, the system combines computer vision, embedded systems, and robotics to create a self-centering camera platform.

The system uses:
- **Desktop Application** (PyQt5) - Face/gesture detection and servo control
- **ESP32-C3 Microcontroller** - Servo motor driver and command processing
- **Pan-Tilt Mechanism** - Dual servo motors for 2-axis tracking
- **Virtual Camera Integration** - Stream tracked video to Zoom, OBS, etc.

---

## ✨ Features

- βœ… **Real-time Face Detection** - Powered by MediaPipe
- βœ… **Gesture-based Control** - Lock/unlock tracking with hand gestures
- βœ… **Autonomous Tracking** - Servos automatically center face in frame
- βœ… **Virtual Camera Support** - Stream to OBS, Zoom, Teams
- βœ… **Desktop Application** - Full PyQt5 GUI with live preview

---

## πŸ“ Project Structure

```
Face-Tracking-WebCam/
β”œβ”€β”€ desktop-app/
β”‚ β”œβ”€β”€ app/
β”‚ β”‚ β”œβ”€β”€ main.py # PyQt5 GUI entry point
β”‚ β”‚ β”œβ”€β”€ video_thread.py # Video capture & face tracking
β”‚ β”‚ β”œβ”€β”€ servo_controller.py # Serial communication with ESP32-C3
β”‚ β”‚ β”œβ”€β”€ gesture.py # Hand gesture detection
β”‚ β”‚ parameters
β”‚ β”œβ”€β”€ requirements.txt
β”‚ └── README.md
β”œβ”€β”€ device-firmware/
β”‚ β”œβ”€β”€ src/
β”‚ β”‚ └── main.cpp # ESP32-C3 servo control firmware
β”‚ β”œβ”€β”€ platformio.ini
β”‚ └── README.md
β”œβ”€β”€ assets/
β”‚ β”œβ”€β”€ esp32_c3_supermini.jpeg
β”‚ β”œβ”€β”€ circuit.png
β”‚ └── ...
β”œβ”€β”€ README.md
└── .gitignore
```

---

## πŸ”§ Hardware Requirements

- **Microcontroller**: ESP32-C3 SuperMini
- **Servos**: 2Γ— SG90 Pan-Tilt Servos (180Β° range)
- **Webcam**: Logitech C270 HD (or compatible USB camera)
- **Servo Bracket**: Pan-Tilt mount
- **USB Cable**: Type-C (ESP32-C3 connection)

### Hardware Connections

| ESP32-C3 Pin | Component |
|--------------|-----------|
| GPIO 4 | Pan Servo Signal |
| GPIO 3 | Tilt Servo Signal |
| GND | Servo GND |
| 5V | Servo VCC (via external PSU) |

---

## πŸ’» Software Requirements

### Desktop Application
- Python 3.8+
- PyQt5
- OpenCV (cv2)
- MediaPipe
- pyvirtualcam

### ESP32-C3 Firmware
- PlatformIO
- ESP32Servo library

---

## πŸ“¦ Installation

### Desktop Application Setup

1. **Clone the repository**
```bash
git clone https://github.com/AkinduID/FazeTrak.git
cd FazeTrak/desktop-app
```

2. **Create virtual environment** (recommended)
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```

3. **Install dependencies**
```bash
pip install -r requirements.txt
```

### ESP32-C3 Firmware Setup

1. **Install PlatformIO**
```bash
pip install platformio
```

2. **Navigate to firmware directory**
```bash
cd device-firmware
```

3. **Build and upload**
```bash
platformio run -t upload
```

---

## πŸš€ Usage

### Starting the Desktop Application

```bash
cd desktop-app
python -m app.main
```

**Controls:**
- **Start Tracking** - Begin face detection and servo control
- **Stop Tracking** - Stop the tracking system
- **Hand Gestures**:
- βœ‹ **Open Palm** β†’ Release face lock
- ✊ **Closed Fist** β†’ Lock face and start tracking

**Visual Feedback:**
- πŸ”΅ **Blue circle** - Raw face detection (noisy)
- 🟑 **Yellow circle** - Kalman Filter estimate (smooth)
- 🟒 **Green rectangle** - Face bounding box
- 🟒 **Green line** - Servo aim vector

---

## πŸ—οΈ System Architecture

```
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Desktop Application (PyQt5) β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Video Input (Webcam) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Face Detection (MediaPipe) β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
β”‚ β”‚ Servo Control Algorithm β”‚ β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
β”‚ β”‚ β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚ Serial @ 115200 baud
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ ESP32-C3 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Servo Driver β”‚
β”‚ (PWM Generator) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ β”‚
β”Œβ”€β”€β–Όβ”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”
β”‚ Pan β”‚ β”‚Tilt β”‚
β”‚Servoβ”‚ β”‚Servoβ”‚
β””β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”˜
```

---

## πŸ“š Documentation

For detailed progress and technical documentation, see:
- [GitHub Wiki](https://github.com/AkinduID/FazeTrak/wiki) - Weekly progress and technical details
- [Desktop App README](desktop-app/README.md)
- [Firmware README](device-firmware/README.md)

---

## 🀝 Contributing

Contributions are welcome! Please follow these steps:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request