Create-Face-Data-from-Images
Using OpenCV Face Detection Neural Network to separate faces from list of images.
Description
This project uses OpenCV's Face Detecttion Neural Network to detect faces in images and perform two tasks:
- Create images with rectange around faces using data_generator.py and store them in the folder updated_images
- Extract faces from a set of images using face_extractor.py and store them in the folder faces This would make labelling/extarcting faces very easy and could be used for further analysis.
Setup
Python Virtual Environment
- Open the terminal
- Clone the repository to your local machine
- Navigate inside the folder
- Install all dependencies using
pipenv install --ignore-pipfile
- Activate environment using
pipenv shell
pip3
- Open the terminal
- Clone the repository to your local machine
- Navigate inside the folder
- Install all dependencies using
pipenv install -r requirements.txt
Usage
Rectanges around faces
- Create a folder with the name images
- Put all the images inside the folder images
- In the terminal, use the command
python data_generator.py
to generate the images - The generated images will be in the folder updated_images
Extract faces
- Create a folder with the name images
- Put all the images inside the folder images
- In the terminal, use the command
python face_extractor.py
to grab and export faces - The faces will be in the folder faces