SmartFace is a comprehensive facial recognition and authentication system that combines modern computer vision techniques with database management for reliable person identification. The system implements a complete pipeline for face detection, recognition, and management using state-of-the-art technologies.
- Real-time face detection and tracking
- Eye detection for improved accuracy
- User profile management with SQLite database
- Training interface for new users
- Real-time recognition with confidence scoring
- Support for multiple camera inputs
- Automated dataset generation
- Python: Primary programming language
- OpenCV (cv2): Computer vision and image processing
- NumPy: Numerical computations and array operations
- PIL (Python Imaging Library): Image manipulation
- SQLite3: Database management
- Haar Cascade Classifiers
- Pre-trained XML files for face and eye detection
haarcascade_frontalface_default.xml
: Primary face detectorhaarcascade_eye.xml
: Eye detection for validation
- LBPH (Local Binary Pattern Histogram)
- Illumination-invariant face recognition
- Progressive learning capabilities
- Real-time performance optimization
- Confidence scoring for recognition accuracy
- SQLite Database
- User profile storage
- CRUD operations support
- Efficient data retrieval
- Lightweight and portable
├── dataSetGenerator.py # Captures and creates training dataset
├── detectory.py # Main recognition and detection system
├── trainner.py # Trains the face recognition model
├── FaceBase.db # SQLite database for user profiles
├── haarcascade_eye.xml # Eye detection classifier
└── haarcascade_frontalface_default.xml # Face detection classifier
- Captures user images through webcam
- Implements face detection
- Stores captured images in dataset
- Updates user information in database
- Processes collected images
- Creates LBPH face recognition model
- Generates and saves training data
- Optimizes recognition parameters
- Real-time face detection
- User identification
- Profile information display
- Confidence level calculation
- Frame capture from video input
- Conversion to grayscale
- Face detection using Haar Cascades
- Eye detection for validation
- Feature extraction
- Recognition and matching
- Result display
- User ID (Primary Key)
- Name
- Age
- Gender
- Additional profile information
- Numpy array operations for fast processing
- Optimized detection parameters
- Cached data processing
- Efficient database queries
- Webcam or USB camera
- Processor: 2.0 GHz or higher
- RAM: 4GB minimum
- Storage: 1GB free space
- Python 3.x
- OpenCV
- NumPy
- PIL
- SQLite3
- Clone the repository
git clone [repository-url]
- Install required packages
pip install opencv-python numpy pillow
- Initialize the database
python init_database.py
python dataSetGenerator.py
- Enter user ID and name when prompted
- System will capture face images
- Look at different angles when prompted
python trainner.py
- Processes all collected images
- Creates/updates recognition model
python detectory.py
- Starts real-time recognition
- Displays user information when detected
- Face Detection Speed: ~30 FPS
- Recognition Accuracy: >95% under good lighting
- Database Response Time: <100ms
- Training Time: ~1-2 minutes for 100 images
- Ensure good lighting conditions
- Maintain 0.5-1m distance from camera
- Collect varied facial expressions
- Regular model retraining
- Backup database regularly
- Multi-face recognition
- Emotion detection
- Age and gender estimation
- Web interface integration
- Cloud database support
- Mobile application support
- Eltayeb Hassan
BSD
me[at]elteyab[dot]sd