{"id":15442492,"url":"https://github.com/ck-zhang/eyepy","last_synced_at":"2025-04-13T21:20:58.469Z","repository":{"id":257805759,"uuid":"864546447","full_name":"ck-zhang/EyePy","owner":"ck-zhang","description":"EyePy is an eye tracking library easily implementable in your projcets","archived":false,"fork":false,"pushed_at":"2024-10-18T05:20:29.000Z","size":59,"stargazers_count":41,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-18T12:56:32.493Z","etag":null,"topics":["eye-tracking","gaze-track","mediapipe","opencv","python"],"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/ck-zhang.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-09-28T14:06:09.000Z","updated_at":"2024-10-18T05:20:32.000Z","dependencies_parsed_at":"2024-10-21T19:28:20.092Z","dependency_job_id":null,"html_url":"https://github.com/ck-zhang/EyePy","commit_stats":{"total_commits":11,"total_committers":2,"mean_commits":5.5,"dds":"0.18181818181818177","last_synced_commit":"8485801cb3fb6abab1d999902235c3469b2ace32"},"previous_names":["ck-zhang/eyepy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ck-zhang%2FEyePy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ck-zhang%2FEyePy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ck-zhang%2FEyePy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ck-zhang%2FEyePy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ck-zhang","download_url":"https://codeload.github.com/ck-zhang/EyePy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248783268,"owners_count":21160899,"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":["eye-tracking","gaze-track","mediapipe","opencv","python"],"created_at":"2024-10-01T19:28:06.728Z","updated_at":"2025-04-13T21:20:58.433Z","avatar_url":"https://github.com/ck-zhang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EyePy\n\n![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)\n![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)\n![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)\n![GitHub stars](https://img.shields.io/github/stars/ck-zhang/EyePy.svg?style=social)\n\n![Demo](https://github.com/user-attachments/assets/70819837-c689-4516-8b95-0952500014ff)\n\nEyePy is a Python library that provides **webcam-based eye tracking**.\nExtract facial features, train eye tracking model and predict gaze with super easy to use interface.\n\nThe repo also includes a virtual camera script allowing integration with streaming software like OBS.\n\n## Installation\n\nClone this project:\n```shell\ngit clone https://github.com/ck-zhang/EyePy\n```\n\n### Using Pip\n```shell\npython -m venv venv\nsource venv/bin/activate  # On Windows use: venv\\Scripts\\activate\npip install -r requirements.txt\n```\n\n### Using uv\n```shell\n# Install uv https://github.com/astral-sh/uv/?tab=readme-ov-file#installation\npip install uv\nuv sync\nsource venv/bin/activate  # On Windows use: venv\\Scripts\\activate\n```\n\n## Demo\n\nTo run the gaze estimation demo:\n\n```bash\npython demo.py [OPTIONS]\n```\n\n### Options\n\n| Option            | Description                                      | Default             |\n|-------------------|--------------------------------------------------|---------------------|\n| `--filter`        | Filter method (`kalman`, `kde`, `none`)          | `none`              |\n| `--camera`        | Index of the camera to use                       | `0`                 |\n| `--calibration`   | Calibration method (`9p`, `5p`, `lissajous`)     | `9p`                |\n| `--background`    | Path to background image                         | None                |\n| `--confidence`    | Confidence interval for KDE contours (0 to 1)    | `0.5`               |\n\n## Virtual Camera Script (only tested on linux)\n\n```bash\npython virtual_cam.py [OPTIONS]\n```\n\n### Virtual Camera Options\n\n| Option            | Description                                      | Default             |\n|-------------------|--------------------------------------------------|---------------------|\n| `--filter`        | Filter method (`kalman`, `kde`, `none`)          | `none`              |\n| `--camera`        | Index of the camera to use                       | `0`                 |\n| `--calibration`   | Calibration method (`9p`, `5p`, `lissajous`)     | `9p`                |\n| `--confidence`    | Confidence interval for KDE contours (0 to 1)    | `0.5`               |\n\n### Virtual camera demo\n\nhttps://github.com/user-attachments/assets/7337f28c-6ce6-4252-981a-db77db5509f6\n\n## Usage as library\n\n### Initialization\n```python\nfrom EyePy import GazeEstimator\ngaze_estimator = GazeEstimator()\n```\n\n### Feature Extraction\n```python\nimport cv2\nimage = cv2.imread('image.jpg')\nfeatures, blink_detected = gaze_estimator.extract_features(image)\n\nif features is None:\n    print(\"No face detected.\")\nelif blink_detected:\n    print(\"Blink detected!\")\nelse:\n    print(\"Extracted features:\", features)\n```\n\n### Training the Model\n```python\nX = [[...], [...], ...]  # Each element is a feature vector\ny = [[x1, y1], [x2, y2], ...]  # Corresponding gaze coordinates\ngaze_estimator.train(X, y)\n```\n\n### Predicting Gaze Location\n```python\npredicted_gaze = gaze_estimator.predict([features])\nprint(\"Predicted gaze coordinates:\", predicted_gaze[0])\n```\n\n## Future Work\n\n### TODO\n\n- [x] Virtual camera script ~~Integrate with OBS~~\n- [ ] Integrate with opentrack\n\nAny suggestions for features and improvements are welcome.\n\nIf you enjoyed using EyePy, consider giving it a star.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fck-zhang%2Feyepy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fck-zhang%2Feyepy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fck-zhang%2Feyepy/lists"}