Dataset Viewer
Duplicate
The dataset viewer is not available for this split.
Cannot load the dataset split (in streaming mode) to extract the first rows.
Error code:   StreamingRowsError
Exception:    ValueError
Message:      Invalid string class label zips
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/src/worker/utils.py", line 149, in get_rows_or_raise
                  return get_rows(
                      dataset=dataset,
                  ...<4 lines>...
                      column_names=column_names,
                  )
                File "/src/libs/libcommon/src/libcommon/utils.py", line 272, in decorator
                  return func(*args, **kwargs)
                File "/src/services/worker/src/worker/utils.py", line 129, in get_rows
                  rows_plus_one = list(itertools.islice(safe_iter(ds, dataset=dataset), rows_max_number + 1))
                File "/src/services/worker/src/worker/utils.py", line 489, in safe_iter
                  yield from ds.decode(False) if ds.features else ds
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2818, in __iter__
                  for key, example in ex_iterable:
                                      ^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2368, in __iter__
                  example = _apply_feature_types_on_example(
                      example, self.features, token_per_repo_id=self.token_per_repo_id
                  )
                File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2285, in _apply_feature_types_on_example
                  encoded_example = features.encode_example(example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 2162, in encode_example
                  return encode_nested_example(self, example)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1446, in encode_nested_example
                  {k: encode_nested_example(schema[k], obj.get(k), level=level + 1) for k in schema}
                      ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1469, in encode_nested_example
                  return schema.encode_example(obj) if obj is not None else None
                         ~~~~~~~~~~~~~~~~~~~~~^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1144, in encode_example
                  example_data = self.str2int(example_data)
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1081, in str2int
                  output = [self._strval2int(value) for value in values]
                            ~~~~~~~~~~~~~~~~^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/features/features.py", line 1102, in _strval2int
                  raise ValueError(f"Invalid string class label {value}")
              ValueError: Invalid string class label zips

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Nepali Crop Disease Dataset

A consolidated image dataset for crop identification and plant disease detection, merged from multiple public sources and organized by crop, with an accompanying ShareGPT-format conversational dataset for vision-language model finetuning.

Dataset Summary

Images are grouped one folder per crop (e.g. tomato/, apple/, maize/), each labeled with both a crop and a disease (or healthy). The corpus is class-balanced by design:

  • Crops with fewer than 300 images were dropped entirely (9 crops kept out of 17 detected in the source pool).
  • Every kept crop is capped at the same per-class quota (equal counts across crops — no crop dominates the dataset).
  • Within each crop, images are sampled round-robin across disease labels, so a single disease can't dominate that crop's folder.
  • Final split per crop: 4,443 train / 666 val / 666 test, for 47,489 images total across 9 crops.

Labels come from two sources, tracked per-image via a label_source field:

  • metadata — parsed from existing .jsonl/.csv/.json annotation files shipped with a source dataset (higher precision).
  • foldername — inferred by keyword-matching the original folder/file path when no structured metadata was available.

Source Datasets

This dataset merges images from:

Source Link
Kaggle — Crop Disease Detection Dataset https://www.kaggle.com/datasets/snikhilrao/crop-disease-detection-dataset
GitHub — PlantDoc-Dataset https://github.com/pratikkayal/PlantDoc-Dataset
Hugging Face — bd-crop-vegetable-plant-disease-dataset https://huggingface.co/datasets/Saon110/bd-crop-vegetable-plant-disease-dataset

Mendeley Data (6243z8r6t6) was originally scoped for inclusion but was dropped from this build.

Please refer to each original source for its own license and citation requirements — this dataset does not override or supersede those terms. If you are a maintainer of one of the source datasets and have concerns about inclusion or attribution, please open a discussion on this repo.

Dataset Structure

train/<crop>/*.jpg
val/<crop>/*.jpg
test/<crop>/*.jpg
labels_registry.jsonl
sharegpt.jsonl
zips/dataset_part_*.zip   # full archive, for bulk download

labels_registry.jsonl

One row per image:

{"image": "train/tomato/abc123.jpg", "split": "train", "crop": "tomato", "disease": "early blight", "label_source": "metadata"}

sharegpt.jsonl

One conversation per image, formatted for VLM instruction finetuning:

{
  "id": "0000001",
  "image": "train/tomato/abc123.jpg",
  "conversations": [
    {"from": "human", "value": "<image>\nWhat crop is shown in this image, and does it have any disease? If so, name the disease."},
    {"from": "gpt", "value": "This is a Tomato leaf affected by early blight."}
  ]
}

Healthy images get an explicit no-disease answer; images where the disease label couldn't be confidently determined are marked as such rather than guessed.

How to Load

As an image folder (classification)

from datasets import load_dataset

ds = load_dataset(
    "imagefolder",
    data_dir="train",  # or point at an extracted local copy
)

As ShareGPT conversations (VLM finetuning)

from datasets import load_dataset

ds = load_dataset(
    "json",
    data_files="sharegpt.jsonl",
)

Note: image paths in sharegpt.jsonl are relative to the repo root (e.g. train/tomato/abc123.jpg) — resolve them against your local copy of the train/val/test folders (or the extracted zips/ archive) before loading images.

From the zipped archive

from huggingface_hub import hf_hub_download
import zipfile

local_zip = hf_hub_download(
    repo_id="w4ashabii/nepali_crop_data",
    repo_type="dataset",
    filename="zips/dataset_part_000.zip",
)
with zipfile.ZipFile(local_zip) as zf:
    zf.extractall("training_data")

Known Limitations

  • Crop and disease labels are extracted via keyword matching where source metadata wasn't available (label_source: "foldername") — these may contain classification errors and should be spot-checked before use in high-stakes applications.
  • Crops with fewer than 300 available images were dropped to keep the balancing meaningful — this dataset does not cover every crop present in the original source datasets, only the 9 that had enough images.
  • Balancing is enforced at the crop level (equal images per crop) and approximately at the disease level within each crop (round-robin sampling) — it is not a strict guarantee of equal counts per individual disease across the whole dataset. Check labels_registry.jsonl if you need exact per-disease counts.
  • Image quality, resolution, and photographic conditions vary across the source datasets.

Citation

If you use this dataset, please cite the original source datasets listed above in addition to this repository.

Downloads last month
87

Models trained or fine-tuned on w4ashabii/nepali_crop_data