A secure facial authentication system built with Flask & OpenCV
🧠 Computer Vision • 🔒 Cybersecurity • 🌐 Web Application
FaceAuth is a secure and scalable facial recognition–based authentication system designed to eliminate traditional passwords. Built using Flask, OpenCV, and computer vision techniques, it enables real-time user authentication through a clean and intuitive web interface.
This project is ideal for secure access control, academic demonstrations, and cybersecurity-focused applications.
✔️ User registration with multiple facial image captures
✔️ Real-time facial recognition via webcam
✔️ Secure session-based authentication
✔️ User dashboard access control
✔️ Automatic model retraining on user add/delete
✔️ User management (view & delete users)
✔️ Robust error handling
- Password-less biometric authentication
- Flask session-based access control
- Automatic retraining prevents stale identities
- Controlled dataset storage per user
| Homepage | Registration | Recognition |
|---|---|---|
![]() |
![]() |
![]() |
- Backend: Flask (Python)
- Computer Vision: OpenCV
- ML Algorithm: LBPH Face Recognizer
- Frontend: HTML, CSS, Jinja Templates
- Session Management: Flask Sessions
- Storage: File-based dataset
git clone <your-repository-url>
cd facial
2️⃣ Create & Activate Virtual Environment
python -m venv venv
Windows
venv\Scripts\activate
macOS / Linux
source venv/bin/activate
3️⃣ Install Dependencies
pip install Flask opencv-python numpy
If OpenCV causes issues:
pip install opencv-python-headless
▶️ Run the Application
python app.py
🌐 Open in browser:
👉 http://localhost:5000
📘 Usage Guide
🔹 Register New User
Visit /register
Enter a unique username
Start face scan and align your face
System captures images and trains the model
🔹 Recognize User
Go to /recognize
Start recognition
On success, redirected to dashboard
🔹 Delete User
Open registration page
Select and delete user
Model retrains automatically
## Important Notes - Prefer localhost:5000 over 127.0.0.1:5000 for camera access - Ensure your webcam is properly connected - Use Chrome or Firefox for best compatibility

