This project implements a computer vision system for Anti-Spoofing, specifically liveliness detection, using the YOLO (You Only Look Once) model. The system is designed to distinguish between real and fake faces in live webcam or images.
- Clone the repository:
git clone https://github.com/Kaustbh/Anti-Spoofing-Liveliness-Detector
- Install dependencies:
- Before Installing dependencies , create a virtual environmnet , to prevent conflicts between different projects that may have different versions of the same library.
pip install -r requirements.txt
To use the Anti-Spoofing system, follow these steps:
- Run the data collection script to gather real and fake face images using the webcam:
python data_collection.py
- Split the collected data into training, testing, and validation sets:
python split_data.py
- Train the YOLO model:
python train.py
- Run the main script to perform face detection and liveliness detection:
python main.py
The testing
folder contains Python scripts and images for testing the face detection and YOLO model.
To run the tests:
python testing/facedetector.py
python testing/yolotest.py
The data_collection
folder contains scripts for collecting real and fake face images using the webcam. Run the data_collection.py
script to initiate the data collection process.
The training
folder contains scripts and resources for training the YOLO model. The model weights are stored in the weights
folder. To train the model, use the train.py
script.
python training/train.py
data_collection/
: Scripts for collecting real and fake face images using the webcam.testing/
: Python scripts and images for testing the face detection and YOLO scripts.training/
: Scripts and resources for training the YOLO model.weights/
: Folder where trained model weights are stored.main.py
: Main script for face detection and liveliness detection.split_data.py
: Script to split collected data into training, testing, and validation sets.requirements.txt
: List of dependencies.
If you'd like to contribute to this project, please fork the repository and create a pull request. Issues and feature requests are welcome as well!
This project is licensed under the MIT License.