Eyes-Detection / README.md
AndreaPorri's picture
Update README.md
4bf0b15 verified
---
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:
- 10K<n<100K
source_datasets:
- Roboflow Datasets
task_ids:
- face-detection
dataset_info:
- dataset_info.json
---
# <span style="font-size: 2.5em; font-weight: bold;">Accurate Eyes Detection Dataset</span>
# <span style="font-size: 1.5em; font-weight: bold;">Dataset Description</span>
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.
# <span style="font-size: 1.5em; font-weight: bold;">Key features</span>
- 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.
- <u>Various Image acquisition conditions</u>:
- Single person (1 or 2 eyes), whole people, groups, ...
- Open and closed eyes.
- Diversity of lighting and poses.
# <span style="font-size: 1.5em; font-weight: bold;">Repository File Structure</span>
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
```
# <span style="font-size: 1.5em; font-weight: bold;">Loading the Dataset with Hugging Face 🤗</span>
This dataset is in COCO format and can be easily loaded using the <u>datasets library</u> 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 <u>load_dataset</u>, 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. <u>Manual Extraction</u>:
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. <u>Using COCO Annotations Directly</u>:
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()
)
```
# <span style="font-size: 1.5em; font-weight: bold;">Preprocessing e Augmentation applied</span>
1. **<u>Preprocessing</u>**:
- Auto-orientation (with EXIF orientation stripping).
- Resize to 640x640 (Stretch).
2. **<u>Data Augmentation</u>** (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%.
# <span style="font-size: 1.5em; font-weight: bold;">Original Datasets of Origin</span>
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
# <span style="font-size: 1.5em; font-weight: bold;">Expected Uses</span>
- Real-time eye detection.
- Part of an Eye-Tracking pipeline for computer vision applications.
- Academic research.
- Research for medical applications.
# <span style="font-size: 1.5em; font-weight: bold;">Limitations and Ethical Considerations</span>
- The dataset contains <u>images of faces</u>.
- Use permitted <u>only for non-commercial purposes</u>.
- It is the user's responsibility to ensure ethical use in compliance with privacy laws.
# <span style="font-size: 1.5em; font-weight: bold;">License - CC BY-NC-SA 4.0</span>
1. **<u>What you can do</u>**:
- Share - copy and redistribute the material.
- Adapt - remix, transform, and create derivative works.
- Use for research, study, and non-commercial projects.
2. **<u>Mandatory conditions</u>**:
- 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. **<u>Example of attribution</u>**:
"Accurate Eyes Detection Dataset" by AndreaPorri is licensed under CC BY-NC-SA 4.0
Dataset source: https://huggingface.co/datasets/AndreaPorri/Eyes-Detection
# <span style="font-size: 1.5em; font-weight: bold;">Disclaimer</span>
The user is responsible for the ethical and legal use of this dataset. <u>The creator assumes no responsibility for any improper use</u>.
# <span style="font-size: 1.5em; font-weight: bold;">Contacts</span>
For questions or additional information:
- Email: andrea.porri@student.unisi.it
# <span style="font-size: 1.5em; font-weight: bold;">Citation</span>
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}
}