figaro1k / README.md
not-lain's picture
Update README.md
8b4e4dc verified
|
Raw
History Blame Contribute Delete
3.5 kB
---
task_categories:
- image-segmentation
task_ids:
- semantic-segmentation
tags:
- hair-segmentation
- matting
- background-removal
size_categories:
- 1K<n<10K
license: mit
---
# Figaro1k
1,050 unconstrained photographs with pixel-level **hair** segmentation masks, spanning
seven hairstyle classes. Prepared for [nobg](https://github.com/feyninc/nobg).
## Usage
```python
from datasets import load_dataset
ds = load_dataset("nobg/figaro1k")
example = ds["train"][0]
example["image"] # PIL RGB photograph
example["mask"] # PIL L mask, 0 = background, 255 = hair
ds["train"].features["hairstyle"].int2str(example["hairstyle"]) # e.g. "straight"
```
## Splits
| Split | Examples | Per hairstyle |
|:--|--:|--:|
| `train` | 840 | 120 |
| `test` | 210 | 30 |
The split is the original `Training`/`Testing` partition shipped with the dataset, not a
re-split. Verified: no frame index appears in both splits, and all 1,050 frames are present.
## Fields
| Field | Type | Notes |
|:--|:--|:--|
| `image` | `Image` | RGB photograph, original resolution — **sizes vary**, do not assume a fixed shape |
| `mask` | `Image` | Single-channel, `0` = background / `255` = hair, same dimensions as `image` |
| `frame` | `int32` | Original frame index (1–1050), from the source filename |
| `hairstyle` | `ClassLabel` | `straight`, `wavy`, `curly`, `kinky`, `braids`, `dreadlocks`, `short-men` |
| `width`, `height` | `int32` | Convenience copies of the image dimensions |
## Preparation notes
Built from the upstream `Figaro1k.zip` (`Original/*.jpg` + `GT/*.pbm`). Three things are
worth knowing if you compare against other conversions:
- **Pairing is by filename** (`FrameNNNNN-org.jpg``FrameNNNNN-gt.pbm`), not by sorted
directory position. The commonly-referenced loader in
[YBIGTA/pytorch-hair-segmentation](https://github.com/YBIGTA/pytorch-hair-segmentation)
pairs positionally, and some copies of the archive ship duplicate `(1).pbm` masks that
silently misalign every later pair.
- **Masks are `255` = hair.** The source is 1-bit PBM, whose polarity is easy to invert by
accident. Confirmed here two ways: masks cover only ~2 % of the image border, and pixels
inside the mask are markedly darker than outside (mean luminance 98 vs 154).
- **No resizing, cropping or normalization** was applied; images are stored at original
resolution. Hair covers ~34–41 % of pixels on average because the source images are
tightly cropped around heads.
`hairstyle` is recovered from the frame index in blocks of 150 (frames 1–150 straight,
151–300 wavy, …), per the class ranges documented upstream. The resulting per-class counts
come out exactly balanced, which cross-checks the mapping.
## Citation
Figaro1k is released by the original authors for **research purposes**; see the
[project page](http://projects.i-ctm.eu/it/progetto/figaro-1k), we also acquired the data thanks to the work from [YBIGTA](https://github.com/YBIGTA/pytorch-hair-segmentation). This repository redistributes
the images in a converted format and claims no additional rights over them. Cite the
original work:
```bibtex
@inproceedings{svanera2016figaro,
title={Figaro, hair detection and segmentation in the wild},
author={Svanera, Michele and Muhammad, Umar Riaz and Leonardi, Riccardo and Benini, Sergio},
booktitle={2016 IEEE International Conference on Image Processing (ICIP)},
pages={933--937},
year={2016},
organization={IEEE}
}
```