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.
- Real-time face detection and recognition.
- User information retrieval from a SQLite database.
- Easy to set up and run.
- Python 3.x
- OpenCV
- NumPy
- SQLite
You can install the required libraries using pip:
pip install opencv-python numpy
-
Clone this repository:
git clone https://github.com/mimi-netizen/Face-recognition.git cd Face-recognition
-
Download the Haar Cascade file for face detection:
- Ensure
haarcascade_frontalface_default.xml
is present in the project directory.
- Ensure
-
Set up the SQLite database:
- Create a SQLite database (
sqlite.db
) and a table namedSTUDENTS
with appropriate fields.
- Create a SQLite database (
-
Create Dataset:
- Run
dataset_creator.py
to capture images for training.
python dataset_creator.py
- Run
-
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
- Run the
-
Start the face recognition application:
python detect.py
-
Press
q
to exit the application.
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
- 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.