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.
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
Schema
Loading the masks
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.
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
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