{"id":21881389,"url":"https://github.com/imprvhub/somnolence-detection","last_synced_at":"2026-04-10T21:10:34.747Z","repository":{"id":264691087,"uuid":"893703407","full_name":"imprvhub/somnolence-detection","owner":"imprvhub","description":"Real-time driver drowsiness detection system using computer vision, OpenCV, and MediaPipe face mesh. Monitors eye movements and calculates Eye Aspect Ratio (EAR) to detect fatigue, providing immediate visual alerts for enhanced driving safety.","archived":false,"fork":false,"pushed_at":"2024-11-25T19:05:28.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T00:44:47.308Z","etag":null,"topics":["computer-vision","drowsiness-detection","eye-tracking","facial-landmarks","mediapipe","opencv","python","real-time-processing","safety-system","somnolence-detection"],"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/imprvhub.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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-11-25T03:56:30.000Z","updated_at":"2025-03-11T06:59:05.000Z","dependencies_parsed_at":"2024-11-25T20:29:39.469Z","dependency_job_id":null,"html_url":"https://github.com/imprvhub/somnolence-detection","commit_stats":null,"previous_names":["imprvhub/somnolence-detection"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/imprvhub/somnolence-detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imprvhub%2Fsomnolence-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imprvhub%2Fsomnolence-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imprvhub%2Fsomnolence-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imprvhub%2Fsomnolence-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imprvhub","download_url":"https://codeload.github.com/imprvhub/somnolence-detection/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imprvhub%2Fsomnolence-detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31659134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"ssl_error","status_checked_at":"2026-04-10T17:19:13.364Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["computer-vision","drowsiness-detection","eye-tracking","facial-landmarks","mediapipe","opencv","python","real-time-processing","safety-system","somnolence-detection"],"created_at":"2024-11-28T09:18:44.304Z","updated_at":"2026-04-10T21:10:34.714Z","avatar_url":"https://github.com/imprvhub.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Somnolence Detection System\n\nA real-time computer vision solution for driver drowsiness detection using OpenCV and MediaPipe face mesh detection.\n\n\u003e 🚧 Initial Release: Core drowsiness detection system implemented with plans for enhancement.\n\n## Overview\n\nThis project implements a drowsiness detection system that monitors a user's eyes in real-time to detect signs of fatigue and alertness. Using advanced computer vision techniques, it calculates the Eye Aspect Ratio (EAR) to determine if a person's eyes are closing for extended periods, indicating potential drowsiness.\n\n## Key Features\n\n- Real-time eye tracking using MediaPipe Face Mesh\n- Eye Aspect Ratio (EAR) calculation\n- Visual drowsiness alerts\n- Live EAR value display\n- Face mesh visualization\n- Mirror display for user comfort\n\n## Technical Components\n\n**Eye Detection**\n- Precise 6-point eye landmark detection\n- Individual left and right eye tracking\n- Real-time EAR calculation\n\n**Alert System**\n- Dynamic threshold-based detection\n- Visual alert system with on-screen warnings\n- Configurable sensitivity settings\n\n## Requirements\n\n- Python 3.8+\n- Webcam\n- Dependencies:\n  - OpenCV (cv2)\n  - MediaPipe\n  - NumPy\n  - SciPy\n\n## Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/imprvhub/somnolence-detection.git\ncd somnolence-detection\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run the application\npython somnolence_detection.py\n```\n\n## Usage\n\nThe application will launch with webcam activation. Use the following controls:\n- `q` - Quit the application\n- Visual indicators will show:\n  - Green eye contours for tracking visualization\n  - EAR value display\n  - Red warning text for drowsiness alerts\n\n## Configuration\n\nKey parameters can be adjusted in the code:\n- `EAR_THRESH`: Eye Aspect Ratio threshold (default: 0.25)\n- `CLOSED_EYES_FRAME`: Consecutive frames for alert (default: 20)\n\n## Roadmap\n\n- [ ] Configurable settings interface\n- [ ] Audio alerts\n- [ ] Data logging and analytics\n- [ ] Multiple face tracking\n- [ ] Mobile device support\n- [ ] Performance optimization for low-power devices\n\n### Key Notes\nThis project showcases computer vision and gesture recognition techniques. The gestures were chosen for their detection reliability and technical suitability, without intent to define or standardize their meanings, acknowledging cultural variations.\n\n#### Intended Use\n- Research and academic purposes\n- Technical demonstrations\n- Computer vision development\n\n### Testing\nThe project includes automated tests using pytest. Tests cover core functionality, EAR calculations, and system robustness.\n\n```bash\n# Install development dependencies\npip install -r requirements-dev.txt\n\n# Run tests\npytest -v\n```\n\nFor detailed test coverage: `pytest --cov=somnolence_detection`\n\n#### License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE.md) file in the root directory of this repository for detailed terms and conditions.\n\n---\n*Built with OpenCV and MediaPipe*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimprvhub%2Fsomnolence-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimprvhub%2Fsomnolence-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimprvhub%2Fsomnolence-detection/lists"}