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.ptfrom 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+ optionalweights/face_landmarker.task). - scripts/video_infer.py β Run on video files.
- scripts/focus_infer.py β Focus/attention inference.
- weights/ β Put
best.pthere;face_landmarker.taskis downloaded on first webcam run if missing. - docs/ β Extra docs (e.g. UNNECESSARY_FILES.md if present).
Dataset
- Source: Kaggle β open/closed eyes
- 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
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.pypython scripts/video_infer.py(expects 1.mp4 / 2.mp4 in repo root or setVIDEOSenv)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.