Skip to content

This project implements a face recognition system using Python, OpenCV, and SQLite.

Notifications You must be signed in to change notification settings

mimi-netizen/Face-recognition

Repository files navigation

Complete Face Recognition Using SQL Database Project

This project implements a face recognition system using Python, OpenCV, and SQLite. The system captures video from a webcam, detects faces, recognizes them using a trained model, and retrieves user information from a SQLite database.

Table of Contents

Features

  • Real-time face detection and recognition.
  • User information retrieval from a SQLite database.
  • Easy to set up and run.

Requirements

  • Python 3.x
  • OpenCV
  • NumPy
  • SQLite

You can install the required libraries using pip:

pip install opencv-python numpy

Installation

  1. Clone this repository:

    git clone https://github.com/mimi-netizen/Face-recognition.git
    
    cd Face-recognition
  2. Download the Haar Cascade file for face detection:

    • Ensure haarcascade_frontalface_default.xml is present in the project directory.
  3. Set up the SQLite database:

    • Create a SQLite database (sqlite.db) and a table named STUDENTS with appropriate fields.

Usage

  1. Create Dataset:

    • Run dataset_creator.py to capture images for training.
    python dataset_creator.py
  2. Train the model (if not already trained):

    • Run the trainer.py script to train the face recognizer using images stored in the dataset.
    python trainer.py
  3. Start the face recognition application:

    python detect.py
  4. Press q to exit the application.

File Structure

Face-recognition/
│
├── .idea/                     # IDE-specific files
├── __pycache__/               # Compiled Python files
├── haarcascade_frontalface_default.xml  # Haar Cascade file for face detection
├── database.db                # SQLite database file
├── dataset_creator.py         # Module to create datasets
├── detect.py                  # Main detection script
├── sqlite.db                  # SQLite database file
├── trainer.py                 # Script to train the face recognizer
└── README.md                  # Project documentation

Notes

  • Customize the database setup instructions according to your actual database schema.
  • Ensure that all necessary files are correctly referenced and included in your repository.
  • You may want to include more detailed instructions or features based on your specific implementation.

About

This project implements a face recognition system using Python, OpenCV, and SQLite.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages