- Table of Contents
- Revolutionizing Attendance with Edge Computing and Deep Learning
- Features
- Hardware Requirements
- Software Dependencies
- Installation
- Usage
- Project Structure
- Configuration
- Contributing
- License
- Acknowledgments
- Presentation
Welcome to PiPresence—an automated attendance tracking solution powered by YOLOv8 and MobileFaceNet, designed to run efficiently on edge devices like the Raspberry Pi 4B. By leveraging state-of-the-art deep learning models and edge computing, PiPresence delivers accurate, real-time face detection and recognition without requiring external servers.
- Advanced Face Detection: Uses YOLOv8n for efficient and accurate face detection
- Robust Face Recognition: Implements MobileFaceNet for reliable face recognition
- Multiple Profile Support: Handles left, front, and right face profiles for better accuracy
- Edge Processing: All computations performed locally on the Raspberry Pi
- Real-time Processing: Supports both real-time camera feed and batch image processing
- Flexible Integration: Choice of weighted average, clustering, or distance-based methods for face embedding
- Comprehensive Logging: Detailed logging system with configurable verbosity
- Raspberry Pi 4B
- Raspberry Pi Camera Module
- MicroSD Card (16GB or larger recommended)
- Power Supply for Raspberry Pi
- Optional: Monitor, Keyboard, and Mouse for setup
- Python 3.9 or higher
- Poetry for dependency management
- Key libraries (automatically managed by Poetry):
- OpenCV Python
- ONNX Runtime
- NumPy
- FAISS-CPU
- Click
- Protobuf
- Clone the Repository
git clone <repository_url>
cd pipresence- Install Poetry (if not already installed)
curl -sSL https://install.python-poetry.org | python3 -- Install Dependencies
poetry install- Set Up Environment
# Activate the virtual environment
poetry shellPiPresence offers several operation modes:
Process and encode faces from input images:
pipresence --encode --input-dir /path/to/raw/images --output-dir /path/to/processed/facesRun real-time face recognition using camera feed:
pipresence --infer --camera --verboseProcess a directory of images:
pipresence --infer --input-dir /path/to/images --output-dir /path/to/outputpipresence/
├── data/
│ ├── models/ # Pre-trained models
│ │ ├── yolov8n-face.onnx
│ │ └── mobilefacenet_fixed.onnx
│ ├── encodings/ # Face embeddings database
│ └── images/ # Input images
├── pipresence/
│ ├── detect_faces.py # Face detection using YOLOv8
│ ├── recognize_faces.py # Face recognition using MobileFaceNet
│ ├── preprocess.py # Image preprocessing
│ ├── config.py # Configuration settings
│ ├── main.py # Main application logic
│ └── tools/
│ └── utils.py # Utility functions
└── pyproject.toml # Project dependencies and metadata
Key parameters can be modified in config.py:
- Detection and recognition thresholds
- Image preprocessing settings
- Model paths
- Directory paths
- Logging verbosity
- Fork the repository
- Create a feature branch
- Make your changes
- Run tests (if available)
- Submit a pull request
This project is licensed under the MIT License. See the LICENSE file for details.
- YOLOv8 for efficient face detection
- MobileFaceNet for accurate face recognition
- ONNX Runtime for optimized model inference
- FAISS for efficient similarity search
The presentation for PiPresence is available in the Assets folder under /doc. You can view it via the following link:
For issues, feature requests, or contributions, please open an issue or pull request on the repository.
