Autolock V4 is a face recognition system designed to enhance security by automatically locking and unlocking your computer based on user presence. The system utilizes a YOLOv8 model for face detection and K-Nearest Neighbors (KNN) for face recognition. It can manage a blacklist of faces and prevent unauthorized access.
- Real-time face detection and recognition
- Automatic system locking when user is absent
- Blacklist management for unauthorized faces
- User-friendly interface for creating master profile
- Multi-platform support (Windows, macOS, Linux)
- Basic face detection using YOLOv8
- Simple face recognition with KNN classifier
- Manual system lock when no face detected
- Basic webcam handling and UI display
- Added blacklist system for unauthorized faces
- Improved face recognition accuracy with normalized features
- Increased inactivity timeout to 10 seconds (from 5)
- Added validation during profile creation
- Enhanced error handling and logging
- Added automatic unlock feature using PIN
- Introduced system lock state tracking
- Added lock timestamp monitoring
- PIN-based security for unlock operations
- Improved recognition confidence handling
- Enhanced profile creation with real-time feedback
- Improved recognition speed and accuracy
- Added rolling confidence average for stability
- Reduced false positives with stricter thresholds
- Enhanced feature extraction with HOG
- Added auto-recovery from failed recognition
- Improved multi-threading for lock monitoring
- Auto-switching between available cameras
autolock_v4.py: Main application file containing the face recognition systemrequirements.txt: Lists all Python dependenciesyolov8n-face.pt: YOLOv8 face detection model (download separately)
face_data/: Directory storing face recognition datamaster_embeddings.pkl: Stored face embeddings for master usermaster_knn_model.pkl: Trained KNN model for face recognitionblacklist.pkl: List of blocked face embeddingsmaster_feature_dim.txt: Feature dimensions configuration
tests/test_face_recognition.py: Unit tests for face recognition systemtest_system_lock.py: Tests for system locking functionalitytest_blacklist.py: Tests for blacklist managementconftest.py: PyTest configuration and fixtures
scripts/setup_camera.py: Utility to test and configure webcammodel_download.py: Script to download YOLOv8 face modelprofile_cleanup.py: Tool to reset master profileperformance_test.py: Benchmarking script
docs/setup_guide.md: Detailed installation instructionstroubleshooting.md: Common issues and solutionsapi_reference.md: API documentationCONTRIBUTING.md: Guidelines for contributors
Run the test suite:
python -m pytest tests/Run specific test categories:
python -m pytest tests/test_face_recognition.py
python -m pytest tests/test_system_lock.pyGenerate test coverage report:
python -m pytest --cov=src tests/- Clone and install dependencies:
git clone <repository-url>
cd autolock-v4
pip install -r requirements.txt- Download YOLOv8 model:
python scripts/model_download.py- Test camera setup:
python scripts/setup_camera.py- Run performance tests:
python scripts/performance_test.py- Python 3.7 or higher
- pip (Python package installer)
-
Clone the repository:
git clone <repository-url> cd autolock-v4 -
Install the required packages:
pip install -r requirements.txt
To run the face recognition system:
python src/autolock_v4.py
Optional arguments:
--model: Path to YOLOv8 face detection model--data-dir: Directory for face recognition data--master: Name for master user--timeout: Inactivity timeout before locking--tolerance: Recognition confidence tolerance--retrain: Force retraining of master profile
This project is licensed under the MIT License - see the LICENSE file for details.
- YOLOv8 for face detection
- OpenCV for image processing
- scikit-learn for machine learning algorithms
For any issues or feature requests, please open an issue on the GitHub repository.