{"id":24041716,"url":"https://github.com/solveditnpc/face_recognition_using_opencv-python","last_synced_at":"2026-04-09T11:03:09.625Z","repository":{"id":247049526,"uuid":"824160319","full_name":"solveditnpc/face_recognition_using_opencv-python","owner":"solveditnpc","description":"face_recognition  using opencv-python and face_recognition module","archived":false,"fork":false,"pushed_at":"2025-01-10T18:47:53.000Z","size":2913,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-26T08:17:20.791Z","etag":null,"topics":["2025","attendance-management-system","attendance-system","easy-to-deploy","easy-to-understand","face-detection","face-recognition","face-tracking","installation-guides","linux","macos","opencv-python","python","windows","works-with-preexisting-hardware"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solveditnpc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-04T13:37:04.000Z","updated_at":"2025-01-10T18:49:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"212f8049-230b-4f93-ba3a-215461a4e09a","html_url":"https://github.com/solveditnpc/face_recognition_using_opencv-python","commit_stats":null,"previous_names":["solveditnpc/face_recognition_using_opencv-python"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/solveditnpc/face_recognition_using_opencv-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solveditnpc%2Fface_recognition_using_opencv-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solveditnpc%2Fface_recognition_using_opencv-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solveditnpc%2Fface_recognition_using_opencv-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solveditnpc%2Fface_recognition_using_opencv-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solveditnpc","download_url":"https://codeload.github.com/solveditnpc/face_recognition_using_opencv-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solveditnpc%2Fface_recognition_using_opencv-python/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265436867,"owners_count":23765049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2025","attendance-management-system","attendance-system","easy-to-deploy","easy-to-understand","face-detection","face-recognition","face-tracking","installation-guides","linux","macos","opencv-python","python","windows","works-with-preexisting-hardware"],"created_at":"2025-01-08T22:12:03.336Z","updated_at":"2025-12-30T22:07:32.460Z","avatar_url":"https://github.com/solveditnpc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face Recognition Attendance System\n\nA simple and efficient face recognition attendance system using OpenCV and Python for windows,linux and mac. The system stores attendance records in CSV format, making it lightweight and easy to use. unknown faces are stored in the `unknown_faces` folder.\n\n## Features\n\n- Real-time face detection and recognition\n- Automated attendance marking\n- CSV export functionality for attendance records\n- Multiple face recognition support\n- High accuracy using deep learning models\n- Attendance history tracking\n- Easy user registration system\n- Unrecognized faces storage in `unknown_faces` folder\n- Detailed logging system\n\n## Configuration\n\n1. add the images of the people with their names as the image name in the `database1` folder.\n   example: `barack_obama.jpg`  // not neccessary to save the images with the name of the person as the image name\n\n2. add the image name and the name of the person you want to associate with that image in the `store1.csv` file.\n   // you can import a file with the format `name` `image_name` if you want to import your own file ,change the file name or the file path in the attendance scripts\n   example:`barack_obama.jpg`,`barack_obama`\n\n## Installation Guide\n\n### Windows Installation\n\n1. Install Python (preferably 3.7.6 since requirements_windows.txt is for 3.7.6, to do a maual installation use python 3.11.0 for latest dlib libraries):\n   - Download Python from [python.org](https://www.python.org/downloads/)\n   - During installation, make sure to check \"Add Python to PATH\"\n\n2. Install all required packages:\n   ```bash\n   pip install -r requirements_windows.txt\n   ```\n\nNote: If you encounter any installation errors, refer to the Troubleshooting section below.\n\n### Linux Installation\n\n1. Install system dependencies:\n   ```bash\n   sudo apt-get update\n   sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \\\n   libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \\\n   libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl \\\n   git libgtk2.0-dev pkg-config\n   ```\n\n2. Install pyenv:\n   ```bash\n   curl https://pyenv.run | bash\n   ```\n\n3. Add pyenv to your PATH (add these to your ~/.bashrc or ~/.zshrc):\n   ```bash\n   echo 'export PYENV_ROOT=\"$HOME/.pyenv\"' \u003e\u003e ~/.bashrc\n   echo 'command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"' \u003e\u003e ~/.bashrc\n   echo 'eval \"$(pyenv init -)\"' \u003e\u003e ~/.bashrc\n   ```\n\n4. Reload your shell configuration:\n   ```bash\n   source ~/.bashrc\n   ```\n\n5. Install Python 3.7.6 using pyenv:\n   ```bash\n   pyenv install 3.7.6\n   cd folder_you_want_to_install_in\n   pyenv local 3.11.0\n   ```\n\n6. Create and activate a virtual environment:\n   ```bash\n   python -m venv test3.11.0\n   source test3.11.0/bin/activate\n   ```\n\n7. Install required packages:\n   ```bash\n   pip install -r requirements_linux.txt\n   ```\n   OR\n   \n   ```bash\n   # Install CMake first\n   pip install cmake\n\n   # Install dlib with specific version\n   pip install dlib==19.24.0\n\n   # Install face_recognition and opencv\n   pip install face_recognition==1.3.0\n   pip install opencv-python\n   ```\n\nNote: If you encounter any installation errors, refer to the Troubleshooting section below.\n\n### Mac Installation Instructions\n\n1. Install Homebrew (if not already installed):\n   ```bash\n   /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\"\n   ```\n\n2. Install pyenv using Homebrew:\n   ```bash\n   brew install pyenv\n   ```\n\n3. Add pyenv to your shell configuration. Add these lines to your ~/.zshrc or ~/.bash_profile:\n   ```bash\n   echo 'export PYENV_ROOT=\"$HOME/.pyenv\"' \u003e\u003e ~/.zshrc\n   echo 'command -v pyenv \u003e/dev/null || export PATH=\"$PYENV_ROOT/bin:$PATH\"' \u003e\u003e ~/.zshrc\n   echo 'eval \"$(pyenv init -)\"' \u003e\u003e ~/.zshrc\n   ```\n\n4. Restart your terminal or reload the configuration:\n   ```bash\n   source ~/.zshrc\n   ```\n\n5. Install Python using pyenv:\n   ```bash\n   pyenv install 3.11.0\n   cd folder_you_want_to_install_in\n   pyenv local 3.11.0\n   ```\n\n6. Create and activate a virtual environment:\n   ```bash\n   python -m venv test3.11.0\n   source test3.11.0/bin/activate\n   ```\n\n7. Install dependencies:\n   ```bash\n   # Install Xcode Command Line Tools if not already installed\n   xcode-select --install\n   \n   # Install CMake using Homebrew\n   brew install cmake\n   \n   # Install Python dependencies\n   pip install -r requirements_mac.txt\n   ```\n\n## Usage\n\n1. Run the main application:\n   ```bash\n   python attendance_opencv_2.0.py   # On Windows\n   python linux_attendance_opencv_2.0.py  # On Linux\n   python linux_attendance_opencv_2.0.py  # On macOS\n   ```\n\n2. The system will:\n   - Detect faces through your camera/ you can choose one or more external cameras\n   - Recognize registered individuals\n   - Store attendance in CSV format\n   - Save unrecognized faces in the `unknown_faces` folder for later review\n\n## Note\n\n- Ensure good lighting conditions for better face recognition\n- Keep the camera stable for accurate results\n- Make sure to register faces before attempting recognition\n- Check the `unknown_faces` folder periodically to review and potentially register new faces\n- The system automatically creates the `unknown_faces` folder if it doesn't exist\n\n## System Requirements\n\n### Minimum Hardware Requirements\n- Processor: Intel Core i3 or equivalent\n- RAM: 4GB\n- Storage: 1GB free space\n- Camera: 720p webcam\n\n### Recommended Hardware\n- Processor: Intel Core i5 or better\n- RAM: 8GB\n- Storage: 2GB free space\n- Camera: 1080p webcam(works on low resolution cameras but not that well)\n\n## Performance Metrics\n\n- Face Detection Speed: \u003c50ms per frame\n- Recognition Accuracy: \u003e95%\n- False Positive Rate: \u003c0.1%\n- Maximum Simultaneous Faces: 10\n\n## Troubleshooting Common Installation Errors\n\n### 1. RuntimeError: Unsupported image type\nIf you encounter: `RuntimeError: Unsupported image type, must be 8bit gray or RGB image`\n\n**Solution:**\n- Verify you're using 24-bit RGB images\n- Try different image files(sometimes a half face or a blurred image can cause this error)\n- Ensure you're using Python 3.7:\n  ```bash\n  python --version \n  ```\n\n### 2. ModuleNotFoundError: No module named 'face_recognition'\nThis usually occurs due to missing CMake and dlib dependencies.\n\n**Solution:**\n```bash\npip install CMake\npip install dlib\n```\n\n### 3. Unable to Install dlib\nIf you can't install dlib through pip, follow these alternative steps:\n\n1. Download dlib:\n   - Visit [dlib GitHub repository](https://github.com/davisking/dlib.git) or find the dlib.whl for py-3.7.6 in this repository \n   - Download the ZIP file\n   - Extract the downloaded file\n\n2. Install the correct wheel file:\n   - Check your Python version: `python --version`\n   - For Python 3.7: Use `dlib-19.22.99-cp37-cp37m-win_amd64.whl`\n   - Copy the wheel file to your project directory\n   - Install using:\n     ```bash\n     pip install dlib-19.22.99-cp37-cp37m-win_amd64.whl\n     ```\n   Note: Use the appropriate wheel file version matching your Python version\n\n### 4. Using Virtual Environment (Recommended)\nTo avoid dependency conflicts, use a virtual environment:\n\n1. In your code editor:\n   - Click on the Python version in the bottom right\n   - Choose \"Create a Virtual Environment\"\n   - Select Python 3.7.6\n\n2. Activate the virtual environment:\n   ```bash\n   # Windows\n   .\\venv\\Scripts\\activate\n   \n   # Linux/Mac\n   source venv/bin/activate\n   ```\n\n3. Install required packages in the virtual environment:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n### 5. OpenCV GUI Error on Linux\nIf you encounter: `cv2.error: OpenCV... The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support`\n\n**Solution:**\n```bash\nsudo apt-get update\nsudo apt-get install libgtk2.0-dev pkg-config\npip uninstall opencv-python\npip install opencv-python\n```\n\n### 6. GTK Module Error on Linux\nIf you see: `Gtk-Message: Failed to load module \"canberra-gtk-module\"`\n\n**Solution:**\n```bash\nsudo apt-get install -y libglib2.0-0 libsm6 libxext6 libxrender-dev libgl1-mesa-glx\nsudo apt-get install -y python3-opencv\npip uninstall opencv-python opencv-python-headless\npip install opencv-python --no-cache-dir\n```\n\n### 7. Face Recognition Type Error on Linux\nIf you encounter: `TypeError: compute_face_descriptor(): incompatible function arguments`\n\n**Solution:**\n```bash\n# First, install system dependencies\nsudo apt-get install build-essential cmake\nsudo apt-get install libopenblas-dev liblapack-dev\nsudo apt-get install libx11-dev libgtk-3-dev\n\n# Then install compatible versions of dlib and face_recognition\npip uninstall dlib face_recognition\npip install dlib==19.24.0\npip install face_recognition==1.3.0\n```\n\n## Future Enhancements\n\n1. **Planned Features**\n   - Mobile application integration\n   - Cloud synchronization\n   - Advanced analytics dashboard\n   - Multi-location support\n   - API integration capabilities\n\n2. **Under Development**\n   - Automated reporting system\n\n## Contributing\n\ncontributions are welcome! Please follow these steps:\n\n1. Fork the repository\n2. Create a feature branch\n3. Commit changes\n4. Push to the branch\n5. Create a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\nFor support and queries:\n- Create an issue in the repository\n- Contact: neutralwritergithubdedicated@gmail.com\n- Documentation: [Wiki](https://github.com/solveditnpc/face_recognition_using_opencv-python.git)\n\n## Acknowledgments\n\n- OpenCV community\n- dlib developers\n\n## Version History\n\n- v2.0 (Current): Added anti-spoofing, improved GUI\n- v1.5: Multiple face recognition support\n- v1.0: Initial release with basic features\n\n## Project Status\n\nActive development - Regular updates and maintenance ongoing.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolveditnpc%2Fface_recognition_using_opencv-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolveditnpc%2Fface_recognition_using_opencv-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolveditnpc%2Fface_recognition_using_opencv-python/lists"}