--- pretty_name: MM-LUCAS license: apache-2.0 task_categories: - image-text-to-text - visual-question-answering size_categories: - 1K}`, the photo. The path is the SHA256 of the image bytes and points into a zip shard through `images/path_to_shard.parquet`. - `id`: `mm_lucas_train_`, for example `mm_lucas_train_0`. - `messages`: one user turn (image, then question, with options for land cover and land use) and one assistant turn (answer). - `raw_metadata`: JSON string with `source_file`, `raw_image_paths`, the photo's row from `4_mm_lucas.csv` (`Quality Score`, `Aesthetic Score`, `gps_long`, `gps_lat`, `date`, `nuts0`, `lc1`, `lc1_label`, `lu1`, `lu1_label`, `Classes`), and the hashes `segmentation_mask`, `segmentation_mask_color` and `depth_map`. Example: ```json { "images": [{"bytes": null, "path": "43603b3cd5a171bb6529ade45f2d05f00b3bff30e84f2d9231ebceed77eacc0c"}], "id": "mm_lucas_train_1784", "messages": [ {"role": "user", "content": [ {"type": "image", "text": null}, {"type": "text", "text": "What is the primary land cover visible here?\nA. Other fresh vegetables\nB. Permanent industrial crops\nC. Sand\nD. Broadleaved woodland"} ]}, {"role": "assistant", "content": [{"type": "text", "text": "A. Other fresh vegetables"}]} ], "raw_metadata": "{\"source_file\": \"5_land_cover.json\", \"raw_image_paths\": [\"26441764N.png\"], \"Quality Score\": \"4.22265625\", \"Aesthetic Score\": \"1.99609375\", \"gps_long\": \"-8.918611\", \"gps_lat\": \"37.07296\", \"date\": \"28/05/2018 12:00\", \"nuts0\": \"PT\", \"lc1\": \"B43\", \"lc1_label\": \"Other fresh vegetables\", \"lu1\": \"U113\", \"lu1_label\": \"Kitchen garden\", \"Classes\": \"Sky, Tree, Background, Terrain, Plant_Bush, Flowerfield, Earth_Ground\", \"segmentation_mask\": \"9cd7a330b5e5591bfcd3a52952b0b7ddfbfba09cbb14f938a9e5048b6d2eeaf0\", \"segmentation_mask_color\": \"b218854f7f2fb5c38692d66655dc3d78d725783093e0e01d6d29a4ff21017e2d\", \"depth_map\": \"c010ba9b3a045d5147acfb78413f0440afefbaf241d35d2d90da7b2092ec81dd\"}" } ``` ### Changes from the original data - Built from the four QA files. Rows follow the files in alphabetical order (aesthetics, land cover, land use, quality), each in its source order, so all 7,136 questions are kept. The source has no split, so all rows are in one `train` split. - Land cover and land use options are added to the question as lines like `A. text`. The answer letter is combined with its option text, for example `A. Other fresh vegetables`. Aesthetics and quality answers are kept as written. - The QA files name each photo as `.png`, while the photo is stored as `.jpg` in `1_images`. The name as written is kept in `raw_image_paths`. - The CSV row of each photo is added to `raw_metadata` with its values kept as written, including the numeric quality and aesthetic scores. - `segmentation_mask`, `segmentation_mask_color` and `depth_map` are added to `raw_metadata`. They are not source fields: they hold the hashes of the files with the same name in `2_seg`, `2_seg_color` and `3_depth`. - All 7,136 files in the four folders are packed (1,784 each). Files are stored once, deduplicated by SHA256, which leaves 7,086 unique files, because some masks of different photos are identical. ## Usage ```python from agml import loadImageTextToTextDataset dataset = loadImageTextToTextDataset("Project-AgML/MM-LUCAS") sample = dataset["train"][0] sample["images"] # list of PIL images sample["messages"] ``` ### Loading the masks and depth maps The loader only decodes the photo, because the masks and depth maps are not part of the conversation. They sit in the same downloaded zip shards, and the dataset's `store` reads any of them by the hash in `raw_metadata`: ```python import io, json import numpy as np from PIL import Image from agml import loadImageTextToTextDataset dataset = loadImageTextToTextDataset("Project-AgML/AgriBench") store = dataset.store # reads any file in images/ by its hash def load_file(file_hash): return Image.open(io.BytesIO(store.getBytes(file_hash))) sample = dataset["train"][0] meta = json.loads(sample["raw_metadata"]) photo = sample["images"][0] # the photo, decoded by the loader mask = np.array(load_file(meta["segmentation_mask"])) # (1200, 1600) uint8, one class ID per pixel mask_color = load_file(meta["segmentation_mask_color"]) # same mask in color depth = load_file(meta["depth_map"]) # Depth Anything V2 output, color PNG print(np.unique(mask)) # class IDs in this photo, e.g. [ 7 8 9 16 18 22 30] print(meta["Classes"]) # class names in this photo, e.g. "Sky, Tree, Background, Terrain, Plant_Bush, Flowerfield, Earth_Ground" ``` ## Citation ```bibtex @article{zhou2024agribench, title={AgriBench: A Hierarchical Agriculture Benchmark for Multimodal Large Language Models}, author={Zhou, Yutong and Ryo, Masahiro}, journal={arXiv preprint arXiv:2412.00465}, year={2024} } @article{martinez2024semantic, title={Semantic segmentation dataset of Land Use/Cover Area frame Survey (LUCAS) rural landscape Street View Images}, author={Martinez-Sanchez, Laura and Hufkens, Koen and Kearsley, Elizabeth and Naydenov, Dimitar and Cz{\'u}cz, B{\'a}lint and van de Velde, Marijn}, journal={Data in Brief}, volume={54}, pages={110394}, year={2024}, publisher={Elsevier} } @article{d2020harmonised, title={Harmonised LUCAS in-situ land cover and use database for field surveys from 2006 to 2018 in the European Union}, author={d'Andrimont, Rapha{\"e}l and Yordanov, Momchil and Martinez-Sanchez, Laura and Eiselt, Beatrice and Palmieri, Alessandra and Dominici, Paolo and Gallego, Javier and Reuter, Hannes Isaak and Joebges, Christian and Lemoine, Guido and others}, journal={Scientific data}, volume={7}, number={1}, pages={352}, year={2020}, publisher={Nature Publishing Group UK London} } ``` This dataset is indexed and structured on https://project-agml.github.io/ as part of Project AgML @ UC Davis. This dataset was reformatted from its original format to match HuggingFace's Imagefolder standards but requires an external module (agml) that processes and returns a HF Dataset object faster than HF module functions.