--- tags: - object-detection - computer-vision - images - COCO-format - medical - eyes annotations_creators: - expert-annotation - Roboflow license: cc-by-nc-sa-4.0 task_categories: - object-detection language: - en - it pretty_name: Accurate Eyes Detection Dataset size_categories: - 10KAccurate Eyes Detection Dataset # Dataset Description This COCO dataset is designed for real-time "precise eye detection" task under various conditions. It contains highly accurate bounding box annotations, manually retraced with **Roboflow** to ensure maximum precision. ## **Dataset Splits** This dataset is intentionally provided as a **single training split** containing all 72,317 examples. This design choice allows researchers to: - Create custom split ratios tailored to their specific needs. - Ensure different random seeds don't lead to overlapping examples between studies. - Implement cross-validation strategies more flexibly. You are responsible for creating appropriate validation and test splits using the provided training data. We recommend using 70-80% for training, 10-15% for validation, and 10-15% for testing, depending on your requirements. # Key features - 72,317 high-resolution images (640×640 pixels, JPG format) featuring close-up eyes, people's faces, and real-life scenes with varying complexity and number of faces. - All bounding boxes have been **completely re-annotated manually** with **Roboflow** to ensure maximum accuracy. - Annotations provided in **ready-to-use COCO format** for easy integration with most object detection frameworks. - **Single Training Split:** The dataset is provided as a single training split to allow maximum flexibility in creating custom train/validation/test splits for different research needs. - Various Image acquisition conditions: - Single person (1 or 2 eyes), whole people, groups, ... - Open and closed eyes. - Diversity of lighting and poses. # Repository File Structure The repository contains the following files. The standard structure for a COCO dataset on Hugging Face is automatically created when loaded. ```text Eyes-Detection/ ├── README.md # This dataset card ├── dataset_info.json # Dataset metadata for Hugging Face ├── annotations.coco.json # Annotations in COCO format ├── images.zip # All images in a single compressed archive ├── README.dataset.txt # Marginal info └── LICENSE # The CC BY-NC-SA 4.0 license file ``` # Loading the Dataset with Hugging Face 🤗 This dataset is in COCO format and can be easily loaded using the datasets library distributed by HuggingFace. **Important Notes:** - **Single Split:** This dataset contains only a **training split** (`train`). You will need to create your own validation and test splits programmatically. - **Images:** The images are provided in a compressed ZIP file (`images.zip`). - **Automatic Extraction:** The `load_dataset` function will automatically extract images from the `images.zip` file. ## **Example Code**: ```python from datasets import load_dataset from sklearn.model_selection import train_test_split import numpy as np # Load the entire dataset as the training split dataset = load_dataset("AndreaPorri/Eyes-Detection") full_train_dataset = dataset['train'] # This contains all 72,317 examples # It is NECESSARY to create a three-part division (training/validation/testing, to obtain and verify results reliably) and keep the test set completely separate from other data during model development and hyperparameter tuning. # First split: 80% train, 20% temp (for val+test) first_split = full_train_dataset.train_test_split(test_size=0.2, seed=42) # Second split: split temp into 50% validation, 50% test (10% each of total) second_split = first_split['test'].train_test_split(test_size=0.5, seed=42) final_dataset = { 'train': first_split['train'], 'validation': second_split['train'], 'test': second_split['test'] } ``` **Note**: When using load_dataset, the extracted images will be cached in the ~/.cache/huggingface/datasets directory, creating the standard folder structure expected by the **COCO loader**. ## **For Advanced Usage (Manual Extraction or COCO Tools):** If you prefer to handle the extraction manually or use the annotations directly with other libraries: 1. Manual Extraction: Download and extract images.zip to a folder. You can then use the data_dir parameter: ```python dataset = load_dataset("AndreaPorri/Eyes-Detection", data_dir="path/to/extracted_images") ``` 2. Using COCO Annotations Directly: The annotations.coco.json file follows the standard COCO format and can be used with libraries like torchvision or pycocotools. ```python from torchvision.datasets import CocoDetection import torchvision.transforms as transforms coco_dataset = CocoDetection( root='path/to/extracted_images', annFile='path/to/annotations.coco.json', transform=transforms.ToTensor() ) ``` # Preprocessing e Augmentation applied 1. **Preprocessing**: - Auto-orientation (with EXIF orientation stripping). - Resize to 640x640 (Stretch). 2. **Data Augmentation** (create 7 versions for each image): - Random crop: 0-30% of the image. - Random rotation: ±15 degrees. - Random shear: ±15° horizontal/vertical. - Brightness adjustment: ±25%. - Exposure adjustment: ±15%. - Gaussian blur: up to 1.2px. - Salt and pepper noise: 0.3% of pixels. - Cutout: 7 boxes, each with a size of 2%. # Original Datasets of Origin This dataset was created based on: 1. **EyeCon Dataset** - https://app.roboflow.com/andreap/eyecon-eaux0-oykgj/1 2. **Eyes Detection Dataset** - https://app.roboflow.com/andreap/eyes_detection-bupne/1 # Expected Uses - Real-time eye detection. - Part of an Eye-Tracking pipeline for computer vision applications. - Academic research. - Research for medical applications. # Limitations and Ethical Considerations - The dataset contains images of faces. - Use permitted only for non-commercial purposes. - It is the user's responsibility to ensure ethical use in compliance with privacy laws. # License - CC BY-NC-SA 4.0 1. **What you can do**: - Share - copy and redistribute the material. - Adapt - remix, transform, and create derivative works. - Use for research, study, and non-commercial projects. 2. **Mandatory conditions**: - Attribution - You must give appropriate credit, provide a link to the license, and indicate if changes were made. - NonCommercial - You may not use the material for commercial purposes. - ShareAlike - If you remix, transform, or create derivative works, you must distribute your contributions under the **same license** as the original. 3. **Example of attribution**: "Accurate Eyes Detection Dataset" by AndreaPorri is licensed under CC BY-NC-SA 4.0 Dataset source: https://huggingface.co/datasets/AndreaPorri/Eyes-Detection # Disclaimer The user is responsible for the ethical and legal use of this dataset. The creator assumes no responsibility for any improper use. # Contacts For questions or additional information: - Email: andrea.porri@student.unisi.it # Citation If you use this dataset in your research, please cite it as: ```bibtex @dataset{accurate_eyes_detection_2025, author = {Andrea Porri}, title = {Accurate Eyes Detection Dataset}, year = {2025}, publisher = {Hugging Face}, version = {2.0}, license = {CC BY-NC-SA 4.0}, url = {https://huggingface.co/datasets/AndreaPorri/Eyes-Detection} }