Spaces:
Sleeping
Sleeping
| # Eye Open / Closed Classifier (YOLOv11-CLS) | |
| Binary classifier: **open** vs **closed** eyes. | |
| Used as a baseline for eye-tracking, drowsiness, or focus detection. | |
| --- | |
| ## Model team task | |
| - **Train** the YOLOv11s-cls eye classifier in a **separate notebook** (data split, epochs, GPU, export `best.pt`). | |
| - Provide **trained weights** (`best.pt`) for this repoβs evaluation and inference scripts. | |
| --- | |
| ## Repo contents | |
| - **notebooks/eye_classifier_colab.ipynb** β Data download (Kaggle), clean, split, undersample, **evaluate** (needs `best.pt` from model team), export. | |
| - **scripts/predict_image.py** β Run classifier on single images (needs `best.pt`). | |
| - **scripts/webcam_live.py** β Live webcam open/closed (needs `best.pt` + optional `weights/face_landmarker.task`). | |
| - **scripts/video_infer.py** β Run on video files. | |
| - **scripts/focus_infer.py** β Focus/attention inference. | |
| - **weights/** β Put `best.pt` here; `face_landmarker.task` is downloaded on first webcam run if missing. | |
| - **docs/** β Extra docs (e.g. UNNECESSARY_FILES.md if present). | |
| --- | |
| ## Dataset | |
| - **Source:** [Kaggle β open/closed eyes](https://www.kaggle.com/datasets/sehriyarmemmedli/open-closed-eyes-dataset) | |
| - The Colab notebook downloads it via `kagglehub`; no local copy in repo. | |
| --- | |
| ## Weights | |
| - Put **best.pt** from the model team in **weights/best.pt** (or `runs/classify/runs_cls/eye_open_closed_cpu/weights/best.pt`). | |
| - For webcam: **face_landmarker.task** is downloaded into **weights/** on first run if missing. | |
| --- | |
| ## Local setup | |
| ```bash | |
| pip install ultralytics opencv-python mediapipe "numpy<2" | |
| ``` | |
| Optional: use a venv. From repo root: | |
| - `python scripts/predict_image.py <image.png>` | |
| - `python scripts/webcam_live.py` | |
| - `python scripts/video_infer.py` (expects 1.mp4 / 2.mp4 in repo root or set `VIDEOS` env) | |
| - `python scripts/focus_infer.py` | |
| --- | |
| ## Project structure | |
| ``` | |
| βββ notebooks/ | |
| β βββ eye_classifier_colab.ipynb # Data + eval (no training) | |
| βββ scripts/ | |
| β βββ predict_image.py | |
| β βββ webcam_live.py | |
| β βββ video_infer.py | |
| β βββ focus_infer.py | |
| βββ weights/ # best.pt, face_landmarker.task | |
| βββ docs/ # extra docs | |
| βββ README.md | |
| βββ venv/ # optional | |
| ``` | |
| Training and weight generation: **model team, separate notebook.** | |