Datasets:
|
Download README.md from asergiu/SynGlass: direct link, hf CLI and curl.
- Browser
- Download file 11.4 kB
-
https://huggingface.co/datasets/asergiu/SynGlass/resolve/main/README.md
- Command line
-
hf download hf://datasets/asergiu/SynGlass/README.md
-
curl -L -o README.md https://huggingface.co/datasets/asergiu/SynGlass/resolve/main/README.md
11.4 kB
| license: cc-by-nc-4.0 | |
| pretty_name: SynGlass | |
| task_categories: | |
| - image-segmentation | |
| tags: | |
| - eyeglasses-segmentation | |
| - synthetic | |
| - human-faces | |
| - unreal-engine-5 | |
| - renderpeople | |
| - webdataset | |
| - bmvc-2026 | |
| - croissant | |
| size_categories: | |
| - 100K<n<1M | |
| language: | |
| - en | |
| viewer: false | |
| # SynGlass: A Large-Scale Synthetic Dataset for Fine-Grained Eyeglasses Segmentation | |
| **BMVC 2026** · Diana-Laura Borza · Alexandru-Ion Marinescu · Robert Bota · Adrian-Sergiu Dărăbant — Babeș-Bolyai University, Cluj-Napoca, Romania | |
| SynGlass is a synthetic dataset for **pixel-accurate eyeglasses lens and frame segmentation**: **332,928 renders** of **128 photorealistic RenderPeople avatars** wearing **867 distinct 3D-scanned eyeglass models**, each avatar–eyeglass pair rendered in Unreal Engine 5 under **3 random near-frontal head poses** in an indoor scene. Masks come straight from the 3D geometry, so they are free of the labelling noise that affects manually annotated thin, reflective frame contours. To our knowledge it is the largest and most diverse dataset dedicated to eyeglasses segmentation, both in image count and in number of frames. | |
| - 📄 Paper: *SynGlass: A Large-Scale Synthetic Dataset for Fine-Grained Eyeglasses Segmentation*, BMVC 2026 (link to be added) | |
| - 🥐 Croissant metadata: [`metadata.json`](./metadata.json) (core + Responsible-AI fields; validated with `mlcroissant`) | |
| - 📜 License: [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/) | |
| - Total size ≈ 1.3 TB (WebDataset TAR shards); start with the `test` shards (22,304 renders) if you only want to evaluate. | |
| ## What is in a render ("capture session") | |
| Files are named `{subject}_{glasses}_{capture_index}_{file_type}.{ext}` and stored under the subject folder, e.g. `subject_073/subject_073_glasses_658_1_color.png`. Subject and eyeglass identifiers are anonymized (`subject_001…subject_128`, `glasses_001…glasses_867`). | |
| | Resource | Format | Content | | |
| |---|---|---| | |
| | `*_color.png` | 1024×1024 PNG (lossless) | Colour render from a frontal camera (horizontal FOV 15°, avatar at 125–175 cm) | | |
| | `*_mask_lens.png` | 1024×1024 RGBA PNG | **Lens mask.** Black (0,0,0,0) = not lens; any non-black pixel = lens, and its RGBA channels encode the normalized camera-view depth (see below) | | |
| | `*_mask_frame.png` | 1024×1024 RGBA PNG | **Frame mask**, same encoding (rim, bridge, temples) | | |
| | `*_meta.json` | JSON | Head rotation `head_rotation_{pitch,yaw,roll}` (deg), `head_position_*`, `eye_{left,right}_position_*`, camera positions/rotations (`{left,mid,right}_cam_*`), `camera_fov`, `slider_avatar_distance` (cm) and the rig sliders (the colour render is the frontal camera view) | | |
| Decoding a mask (NumPy): | |
| ```python | |
| import numpy as np, imageio.v3 as iio | |
| rgba = iio.imread("subject_073/subject_073_glasses_658_1_mask_lens.png").astype(np.float64) # (1024, 1024, 4), 0..255 | |
| mask = rgba.any(axis=-1) # bool: pixel belongs to the lens class | |
| r, g, b, a = np.moveaxis(rgba, -1, 0) | |
| depth = r / (256**1 - 1) + g / (256**2 - 1) + b / (256**3 - 1) + a / (256**4 - 1) # normalized depth in (0, 1], valid where mask | |
| ``` | |
| The two lenses are separate connected components of the lens mask; the paper separates them this way and assigns predicted pixels to the nearest ground-truth lens centroid. | |
| ## Eyeglass models (867) — `manifest/eyeglasses.csv` | |
| Every eyeglass model is a 3D scan of a real frame with separate frame and lens sub-meshes and is labelled along four axes: | |
| | Attribute | Values (number of models) | | |
| |---|---| | |
| | `family` (rim structure) | full-rim 839 (96.8 %) · rimless 17 (2.0 %) · semi-rimless 11 (1.3 %) | | |
| | `material` | plastic 726 (83.7 %) · metal 141 (16.3 %) | | |
| | `shape` (lens outline) | rectangle 182 · cat-eye 181 · round 153 · oval 146 · square 114 · other 47 · aviator 44 | | |
| | `lens_type` | clear 669 · sunglasses 198 | | |
| *full-rim*: a continuous rigid rim encloses each lens; *semi-rimless*: the rim covers only part of the boundary (usually the upper half); *rimless*: lenses attached directly to bridge and temples. The low share of rimless/semi-rimless frames reflects commercial catalogues; they are also the hardest cases for segmentation (see the paper's per-family breakdown). | |
| ## Avatars (128) — `manifest/subjects.csv` | |
| Gender: 73 female · 55 male. Age group: <13: 12 · 13–18: 10 · 19–30: 73 · 31–50: 22 · 50+: 11. Ethnicity: White 73 · Black 23 · Asian 18 · Indian 6 · Middle Eastern 5 · Hispanic/Latino 3. (These are the same 128 avatars as in the authors' HumanStereo dataset.) | |
| ## Head poses | |
| Each avatar–eyeglass pair is rendered three times (`capture_session_index` 1–3): two poses with yaw, pitch and roll drawn from [−2°, 2°] and one with larger deviations in [−7°, 7°] \ [−2°, 2°]. All captures are near-frontal and occlusion-free by design (cooperative subject, as in optometric measurement and frame-retrieval settings). | |
| ## Splits — `manifest/sessions.csv` (column `split`) | |
| The split is **by eyeglass model**, so no frame appears in both training and test; all 128 avatars appear in both. | |
| | Split | Eyeglass models | Renders | Use | | |
| |---|---|---|---| | |
| | `train` | 776 | 297,984 | training | | |
| | `test` | 91 (held out: 84 full-rim, 6 rimless, 1 semi-rimless) | 22,304 | **benchmark test set** — a subsample of the test models' renders whose yaw/pitch/roll distribution matches the training split | | |
| | `test_pool` | the same 91 | 12,640 | the remaining renders of the test models, not part of the benchmark; **never use for training** | | |
| > ⚠️ The TAR shards under `shards/train/` were packed before the `test_pool` split was introduced and therefore physically contain the 12,640 `test_pool` renders. Always select renders through the `split` column of `manifest/sessions.csv` (version 1.1.0 of the manifest); do not train on everything found in the train shards. | |
| ## Repository layout | |
| ``` | |
| README.md | |
| metadata.json Croissant 1.1 (core + RAI), record sets: splits, eyeglasses, subjects, synglass_sessions | |
| manifest/sessions.csv 332,928 rows: session_id, split, human_subject_name, eyeglass_model_name, | |
| capture_session_index, file_stem, color, mask_frame, mask_lens, metadata | |
| manifest/eyeglasses.csv 867 rows: eyeglass_model_name, split, family, material, shape, lens_type | |
| manifest/subjects.csv 128 rows: human_subject_name, gender, age_group, ethnicity | |
| shards/train/train-000000.tar … train-000142.tar (143 shards, ≈4 GB each) | |
| shards/test/test-000000.tar … test-000010.tar (11 shards) | |
| shards/shards_summary.json | |
| ``` | |
| ## Loading | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| root = snapshot_download("asergiu/SynGlass", repo_type="dataset", | |
| allow_patterns=["metadata.json", "manifest/*", "shards/test/*"], | |
| local_dir="/data/synglass") | |
| # extract the shards you downloaded: for f in shards/test/*.tar; do tar -xf "$f" -C /data/synglass; done | |
| import pandas as pd | |
| sessions = pd.read_csv(f"{root}/manifest/sessions.csv") | |
| eyeglasses = pd.read_csv(f"{root}/manifest/eyeglasses.csv") | |
| subjects = pd.read_csv(f"{root}/manifest/subjects.csv") | |
| test = sessions[sessions.split == "test"].merge(eyeglasses, on="eyeglass_model_name", suffixes=("", "_eg")) | |
| row = test.iloc[0] | |
| color_path, lens_path = f"{root}/{row.color}", f"{root}/{row.mask_lens}" | |
| ``` | |
| The shards are WebDataset-style TARs (one sample = the four files sharing a stem), so they can also be streamed with `webdataset` without extraction. | |
| ## Benchmark protocol (from the paper) | |
| - **Pre-processing:** faces are detected with MediaPipe, the box is enlarged by 20 % and re-centred on the eyes, a central crop with width = 2 × height is taken and resized to width 448. | |
| - **Metrics:** IoU; Boundary IoU at 1 and 3 px; and the proposed radial metrics computed per lens from the ground-truth lens centroid over 360 rays — **Radial Threshold Accuracy RTA@δ** (fraction of rays whose radial error ≤ δ px) and **Radial Error RErr** (mean absolute radial error, px). The radial formulation decomposes errors into nasal / temporal / top / bottom quadrants. | |
| - **Reference results (test split, IoU / BIoU@1 / RTA@1 / RErr):** UNet++ EfficientNet-B4 (CE loss) 96.36 / 65.06 / 73.84 / 1.11; SegFormer MiT-B2 96.34 / 61.68 / 70.70 / 1.09; DeepLabV3+ EfficientNet-B4 96.24 / 54.49 / 64.53 / 1.08; zero-shot SAM-2 (box prompt) 93.57 / 26.80 / 38.02 / 1.46. Full-rim frames reach BIoU@1 71.4 vs. 10.3 for rimless. | |
| - **Synthetic-to-real:** pre-training on SynGlass and fine-tuning improves boundary accuracy on real data (FFHQ with overlaid 3D glasses: BIoU@1 69.2 → 71.5; Roboflow lenses: IoU 80.7 → 82.5). | |
| ## Intended uses and limitations | |
| **Intended:** training and benchmarking fine-grained lens/frame segmentation; pre-training for real-world eyeglasses segmentation; boundary-accuracy evaluation; research on optometric measurements (pupillary distance, fitting height, optical centre), frame retrieval and eyewear-aware face analysis. | |
| **Limitations:** entirely synthetic (indoor lighting only; real skin texture, natural illumination and reflections under uncontrolled light are not covered); near-frontal cooperative captures only (|yaw|, |pitch|, |roll| ≤ 7°); strong class imbalance across frame families (only 17 rimless and 11 semi-rimless models; the test set has 6 rimless and 1 semi-rimless model); 128 identities with the demographic skew listed above; identities are shared across splits (only eyeglass models are disjoint). A model that performs well on SynGlass may need adaptation for in-the-wild images. | |
| **Prohibited:** surveillance, covert biometric identification, or any application that could harm individuals; the license is non-commercial. | |
| ## Ethics and licensing | |
| The dataset contains **no real personal data**: all faces are renders of commercially licensed RenderPeople scans, only renders are redistributed (never the 3D assets), and all subject and eyeglass identifiers are anonymized. The eyeglass models are 3D scans of commercial frames; product names are not released. No human annotators were involved. Data: **CC BY-NC 4.0**. | |
| ## Maintenance | |
| Maintained by Prof. Adrian-Sergiu Dărăbant, Department of Computer Science, Babeș-Bolyai University (sergiu.darabant@ubbcluj.ro). Errata are listed here; released versions stay available with version identifiers. | |
| Version history: **1.0.0** (May 2026) initial release · rimless-frame renders added (Aug 2026) · **1.1.0** (Nov 2026) corrected `split` labels (`test_pool` introduced), `eyeglasses.csv` and `subjects.csv` attribute tables, Croissant RAI fields. | |
| ## Citation | |
| ```bibtex | |
| @inproceedings{borza2026synglass, | |
| title = {SynGlass: A Large-Scale Synthetic Dataset for Fine-Grained Eyeglasses Segmentation}, | |
| author = {Borza, Diana-Laura and Marinescu, Alexandru-Ion and Bota, Robert and D{\u{a}}r{\u{a}}bant, Adrian-Sergiu}, | |
| booktitle = {Proceedings of the British Machine Vision Conference (BMVC)}, | |
| year = {2026} | |
| } | |
| ``` | |
| ## Acknowledgements | |
| Supported by the project *Romanian Hub for Artificial Intelligence – HRIA*, 2021–2027, MySMIS no. 351416, and by project PN-IV-P7-7.1-PTE-2024-0105, contract no. 43PTE (05/05/2025). 3D human scans courtesy of [RenderPeople](https://renderpeople.com/) under their commercial license. | |