This project is a Python-based facial recognition system using the OpenCV and face-recognition libraries. The goal of this project is to recognize and identify faces from a set of images stored in a folder. This README file will guide you through the setup and usage of the project.
Before using this project, you need to set up your Python environment and install the required libraries. Follow these steps to get started:
-
Clone the Repository:
git clone https://github.com/akshatbhj/facial-recognition-python.git cd facial-recognition-python
-
Create a Virtual Environment (Optional but recommended):
It's good practice to work in a virtual environment to isolate dependencies. You can create a virtual environment using
virtualenv
:# Install virtualenv if you haven't already pip install virtualenv # Create a virtual environment virtualenv venv # Activate the virtual environment (on Windows, use `venv\Scripts\activate`) source venv/bin/activate
-
Install Dependencies:
Use
pip
to install the required libraries:pip install opencv-python pip install numpy pip install face-recognition
Now that you have set up your environment, you can use the facial recognition system to recognize faces from a folder of images.
-
Prepare the Image Dataset:
Place the images you want to recognize in a folder, for example,
known_faces
. Make sure the images are of good quality and contain the faces you want to recognize. -
Run the Facial Recognition Script:
Run the main facial recognition script:
python main.py
This script will process the images in the specified folder, detect faces, and attempt to recognize them based on the known faces in your dataset.
-
View the Results:
The recognized faces will be displayed, and the recognized names (if available) will be shown alongside the faces.
The project directory is organized as follows:
facial-recognition-project/
│
├── main.py # Main script for facial recognition
├── known_faces/ # Folder containing known faces (reference images)
│ ├── person1.jpg
│ ├── person2.jpg
│ └── ...
└── README.md # This README file
If you encounter any issues or errors while setting up or running the project, please refer to the troubleshooting section in the GitHub repository for this project. You can also open an issue on the repository if you need further assistance.
Contributions to this project are welcome! If you have ideas for improvements or would like to report a bug, please open an issue on the GitHub repository.
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using the Facial Recognition Project! If you have any questions or need further assistance, please don't hesitate to reach out.