Dataset Viewer
Auto-converted to Parquet Duplicate
id
stringlengths
10
10
image
imagewidth (px)
1.08k
2.52k
rgba
imagewidth (px)
1.08k
2.52k
mask
imagewidth (px)
1.08k
2.52k
m_00308c60
m_003d01f4
m_00420d1e
m_004fa5c7
m_008cd4af
m_00b28969
m_00bc1c49
m_00da5380
m_01173901
m_011bff78
m_01680e99
m_019feb04
m_022ca262
m_0254bd86
m_025b9477
m_02704c9b
m_028248d0
m_02a00f17
m_02eb4cab
m_030f1c06
m_031cf2bc
m_036eedc7
m_03b26bbe
m_03de515c
m_04043ea0
m_044115c6
m_04586d5d
m_046204bc
m_0465215b
m_046b71fe
m_048116dd
m_048514b0
m_049b1aa8
m_04d18a06
m_04f27a7c
m_05293522
m_05c7a1bc
m_05ca4ec0
m_05d9e867
m_05f81a0f
m_06153fdf
m_0695e734
m_06e005ef
m_07845e89
m_07a0fb8f
m_07e27dcb
m_07f37ff4
m_080daa03
m_084ef458
m_08d4d271
m_08e4fecc
m_0966b588
m_09683c8c
m_09841796
m_099becb1
m_099ce0cc
m_09a26582
m_09d89abf
m_09ddac1d
m_09f434c3
m_0a466521
m_0a556ca2
m_0a6c2018
m_0a91f684
m_0a9337b4
m_0a966428
m_0acaf8d5
m_0af6512b
m_0b09726c
m_0b0df5db
m_0b203fef
m_0b9901e1
m_0c30c330
m_0c5da817
m_0c6639f8
m_0c7755a7
m_0caf84f7
m_0cd7dddd
m_0d3ac3b2
m_0d3e96b8
m_0d8bae3e
m_0dbb7ee9
m_0e0b9fe5
m_0e0f99d2
m_0e1b0acd
m_0e243992
m_0e38967f
m_0e3a9076
m_0e3db706
m_0e525f1e
m_0e5c2089
m_0e95448a
m_0e9ad9f2
m_0ec7b43d
m_0eeaebc1
m_0f0b401e
m_0f34c979
m_0f56fc34
m_0fad4cf3
m_0ff55079
End of preview. Expand in Data Studio

AM-2K train RGBA

The 1,800 training images of AM-2K, each with its RGB photo, an RGBA PNG and the hand-annotated alpha matte.

from datasets import load_dataset

ds = load_dataset("nobg/am2k-rgba", split="train")   # 1,800 rows
ds[0]["id"]      # 'm_00308c60'
ds[0]["image"]   # PIL RGB, the photo as lossless PNG
ds[0]["rgba"]    # PIL RGBA, the same RGB plus the matte as alpha
ds[0]["mask"]    # PIL L, the 8-bit alpha matte

Columns

column type content
id string AM-2K image id, for example m_00308c60
image Image (RGB PNG) The original photo, converted losslessly from JPEG to PNG
rgba Image (RGBA PNG) The same RGB pixels as image, with the matte in the A channel
mask Image (L PNG) The A channel of rgba, saved as a single-channel PNG

All three images in a row have the same size.

Why this mirror exists

The earlier version of this repo stored loose PNG folders, train/rgb/<id>.png and train/rgba/<id>.png. The dataset viewer read them as an image folder and did not pair them. This version puts each pair in one parquet row, with the id as a column. It also adds the matte as its own L column, so code that expects an image and mask pair works without decoding alpha.

Important limitation

This is not ground-truth isolated foreground color. The photographed RGB includes background contamination wherever alpha is below 255, including translucent edges. At alpha 0 the RGB is the original background. Neither true foreground color nor an uncomposited RGBA image is recoverable from the photo and alpha alone. For foreground extraction or decontamination training, use a separately justified estimation method and report it as estimated. AM-2K's own train/fg estimate is another option. This release does not use or redistribute train/fg or train/bg.

Processing

The source is the official AM-2K release, using only train/original, train/mask and the split manifest am2k_split_category.json. The 200-image validation/test partition is excluded and reserved for evaluation.

  • image is the original JPEG photo decoded and saved as PNG. JPEG decoding is not reversible, so the PNG holds the decoded pixels.
  • Official masks may be L, LA or RGBA PNGs. Following upstream channel-0 handling, the matte is L from L/LA files or R from RGBA files. RGBA masks were required to have R = G = B, and any A channel to be fully opaque or identical to the matte.
  • Alpha is never thresholded or inferred from an unrelated A channel. Soft values from 0 to 255 are kept exactly.
  • rgba is the RGB of image with the matte as the A channel.
  • In this parquet build, image and rgba are the PNG bytes of the previous loose-file release, stored unmodified.
  • mask is rgba.getchannel("A") saved as an L PNG. PNG is lossless.

Verified on the built parquet:

  • 1,800 rows. The ids equal the source file set exactly, with no duplicates.
  • In every row, image, rgba and mask have the same size.
  • In every row, mask decodes as L and equals the rgba alpha channel pixel for pixel.
  • On 60 random rows, image equals the RGB channels of rgba pixel for pixel.
  • On 20 random rows, the SHA-256 of the image and rgba bytes equals the source files.
  • The mattes are soft. The median mask has 256 distinct grey levels and the minimum is 151.

Licensing

The AM-2K dataset release agreement calls the dataset MIT-licensed and requires citation. It also says the source photos were collected from sites with free-use licenses, and copyright remains with their original owners. The dataset provider does not warrant the photos' content. Review the applicable rights before redistribution or use. Do not treat the dataset MIT statement as a transfer of original-photo copyrights.

Source: the official AM-2K release and the GFM project.

Citation

Li, Jizhizi, Jing Zhang, Stephen J. Maybank, and Dacheng Tao. "Bridging Composite and Real: Towards End-to-end Deep Image Matting." International Journal of Computer Vision 130(2), 246-266 (2022). https://doi.org/10.1007/s11263-021-01541-0

@article{li2022bridging,
  title={Bridging Composite and Real: Towards End-to-end Deep Image Matting},
  author={Li, Jizhizi and Zhang, Jing and Maybank, Stephen J. and Tao, Dacheng},
  journal={International Journal of Computer Vision},
  volume={130},
  number={2},
  pages={246--266},
  year={2022},
  doi={10.1007/s11263-021-01541-0}
}
Downloads last month
256