CoolFace
Datasetpublic

kaityc06/Herbarium-2022-FGVC9_masked

Herbarium 2022 FGVC9 Masked Segmentation masks for the Herbarium 2022 FGVC9 dataset, stored as RLE-encoded masks in a single Parquet file. Note: This file covers 15,992 images (63 of 400 shards processed so far). File File Description masks.parquet 15,992 rows — one per image — with RLE mask, score, species label, and file_name Schema Column Type Description dataset str Always Herbarium-2022-FGVC9 text_prompt str Text… See the full description on the dataset page: https://huggingface.co/datasets/kaityc06/Herbarium-2022-FGVC9_masked.

sourceHugging Facecc-by-4.0updated 3mo agoView on Hugging Face
0likes159downloads
Dataset Card

Herbarium 2022 FGVC9 Masked

Segmentation masks for the Herbarium 2022 FGVC9 dataset, stored as RLE-encoded masks in a single Parquet file.

Note: This file covers 15,992 images (63 of 400 shards processed so far).

File

FileDescription
masks.parquet15,992 rows — one per image — with RLE mask, score, species label, and file_name

Schema

ColumnTypeDescription
datasetstrAlways Herbarium-2022-FGVC9
text_promptstrText prompt used to generate the mask (always plant)
mask_rle_countsstrRLE-encoded mask (COCO format)
mask_rle_heightintHeight used for RLE decoding
mask_rle_widthintWidth used for RLE decoding
mask_scorefloatMask confidence score
image_widthintOriginal image width
image_heightintOriginal image height
speciesstrFull species name (e.g. Abies amabilis (Douglas ex Loudon) J.Forbes)
kingdomstrTaxonomic kingdom
familystrTaxonomic family (e.g. Pinaceae)
genusstrTaxonomic genus (e.g. Abies)
file_namestrRelative image path (e.g. 000/00/00000__001.jpg)

Loading the masks

python
import pandas as pd

df = pd.read_parquet("hf://datasets/kaityc06/Herbarium-2022-FGVC9_masked/masks.parquet")

Retrieving the original image by file_name

The file_name column contains the relative path to the image within the Herbarium 2022 dataset.

python
import os
from PIL import Image

# Path to your local Herbarium 2022 download
HERBARIUM_DIR = "/path/to/herbarium2022"

row = df.iloc[0]
img = Image.open(os.path.join(HERBARIUM_DIR, row["file_name"]))

Decoding a mask

python
import numpy as np
from pycocotools import mask as mask_utils

row = df.iloc[0]

rle = {
    "counts": row["mask_rle_counts"],
    "size": [row["mask_rle_height"], row["mask_rle_width"]],
}
binary_mask = mask_utils.decode(rle)  # numpy array, shape (H, W), dtype uint8