--- pretty_name: AIM-500 license: mit task_categories: - image-segmentation - mask-generation size_categories: - n<1K tags: - image-matting - alpha-matting - background-removal - salient-object-detection configs: - config_name: default data_files: - path: data/test-* split: test dataset_info: features: - dtype: string name: image_name - dtype: image name: image - dtype: image name: mask - dtype: string name: category - dtype: string name: type splits: - name: test num_examples: 500 --- # AIM-500 **Automatic Image Matting-500** — 500 high-resolution natural images with **manually labelled alpha mattes**, as one `test` split, which is what the authors published it as. ```python from datasets import load_dataset ds = load_dataset("nobg/AIM-500", split="test") # 500 rows ds[0]["image"] # PIL RGB, original resolution ds[0]["mask"].convert("L") # a real 8-bit alpha matte, not a binary mask # (mode varies upstream — see the note below; convert is lossless) ds[0]["category"] # 'animal' | 'portrait' | 'plant' | ... (7 values) ds[0]["type"] # 'SO' | 'STM' | 'NS' ds[0]["image_name"] # 'o_004cddc9' ``` ## Why this mirror exists The authors distribute AIM-500 as a Google Drive **folder**, not an archive — there is no single URL to `load_dataset` from, and the per-image metadata lives in a separate JSON. This mirror is that folder in parquet with the metadata joined in as two real columns, and with **image and alpha bytes passed through unmodified** (verified by SHA-256 on all 1000 files). The `trimap/` and `usr/` folders are **not** included: both are derived from `mask` and exist for trimap-based matting methods. **The masks are true soft alpha.** Median **256 distinct grey levels** per mask, mean **6.55 %** of pixels strictly between 0 and 255 (max 93.5 %). That is the point of the set, and it is why nothing here re-encodes: a lossy or palettized round trip would destroy exactly the soft edges being measured. Downstream code should **not** binarize these. ## One upstream property to know before you decode The masks are **not all saved in the same PIL mode**: 161 are `L`, 293 are `RGB` and 46 are `RGBA`. Those bytes are the authors' and are passed through as-is. It matters because `.convert("L")` weights RGB by ITU-R 601 and **discards** the alpha channel — either of which would corrupt a matte. Measured on all 339 non-`L` masks in this mirror: every one is **grey-replicated** (`R == G == B` at every pixel) and every `RGBA` one has **fully opaque alpha** (`min == 255`). So the matte lives in the colour channels, not the alpha channel, and `.convert("L")` reproduces it **exactly** — 0 differing pixels. `datasets` decodes these to whatever mode the file declares, so call `.convert("L")` (safe here) rather than assuming `L`, and never read the `A` band as the matte. ## Categories and types | category | images | |:--|--:| | `animal` | 200 | | `portrait` | 100 | | `plant` | 75 | | `furniture` | 45 | | `toy` | 36 | | `transparent` | 34 | | `fruit` | 10 | `type` is the authors' difficulty axis: **SO** salient opaque (424), **STM** salient transparent/meticulous (43), **NS** non-salient (33). The `transparent` category and the `STM` type are the hard slices — useful for isolating where a model's alpha actually fails rather than reporting one average. Published comparator: **GenPercept** reports zero-shot `SAD` **75.5** on AIM-500, against ViTAE-S's 112.52. ## Licensing **MIT**, stated by the authors in the dataset's own `readme.txt` ("The dataset is under MIT license") — no gate and no signed agreement. Please cite the paper. ## Citation ```bibtex @inproceedings{li2021deep, title={Deep Automatic Natural Image Matting}, author={Li, Jizhizi and Zhang, Jing and Tao, Dacheng}, booktitle={IJCAI}, year={2021} } ```