This project aims to provide a real-time face detection and recognition system. It captures face images, encodes them, and then uses these encodings for face detection and recognition.
- Python 3.x
- OpenCV
- Dlib
- NumPy
- Jupyter Notebook
- Clone the repository
git clone https://github.com/your_username/Face_Detection_and_Recognition.git
- Navigate to the project directory
cd Face_Detection_and_Recognition
- Install the required packages
pip install opencv-python pip install face_recognition
Face_Detection_and_Recognition/
├── README.md
├── requirements.txt
├── captured_images/ # Directory for storing captured face images
├── src/
│ ├── capturing_images.py # Script for capturing face images using the camera
│ ├── encodings_creator.py # Script for creating encodings from captured images
│ └── face_detection_and_verification.ipynb # Jupyter Notebook for live face detection and recognition
└── data/
└── known_faces.pkl # Serialized encodings of known faces
capturing_images.py
: Captures face images using the camera and stores them in thecaptured_images/
directory.encodings_creator.py
: Reads images from thecaptured_images/
directory, encodes the faces, and stores the encodings inknown_faces.pkl
.face_detection_and_verification.ipynb
: Contains the main logic for real-time face detection and recognition. Uses the encodings stored inknown_faces.pkl
.known_faces.pkl
: Serialized file that contains the encodings of known faces. Generated byencodings_creator.py
.
- Run
capturing_images.py
to capture face images.python src/capturing_images.py
- Run
encodings_creator.py
to create face encodings.python src/encodings_creator.py
- Open
face_detection_and_verification.ipynb
in Jupyter Notebook and run the cells for live detection and recognition.
To contribute to this project, please fork the repository and submit a pull request.