JUHE API Marketplace
DATASET
Open Source Community

hyperspectral-fruit

The dataset contains 100 images of various fruits and vegetables captured under controlled lighting conditions using a Living Optics camera. Data types include RGB images, sparse spectral samples, and instance segmentation masks. The dataset includes over 430,000 spectral samples, of which more than 85,000 belong to one of 19 categories. Additionally, 13 labeled images are provided as a validation set along with some unlabeled demonstration videos. The dataset is primarily used for image segmentation and classification tasks.

Updated 7/30/2024
huggingface

Description

Living Optics Hyperspectral Fruit Dataset

Overview

This dataset contains 100 images of various fruits and vegetables captured under controlled lighting conditions using a Living Optics Camera. The data include RGB images, sparse spectral samples, and instance segmentation masks. From the 100 images we extracted over 430,000 spectral samples, of which more than 85,000 belong to one of the 19 categories in the dataset. The remaining spectra can be used as negative samples when training classifiers. Additionally, 11 labeled images are provided as a validation set and a set of unannotated .lo demonstration videos are supplied for qualitative testing of algorithms built on this dataset.

Categories

The training set contains 19 categories:

  • 🍋 Lemon – 8,275 total spectral samples
  • 🍈 Melon – 9,507 total spectral samples
  • 🥒 Cucumber – 227 total spectral samples
  • 🍏 Granny Smith Apple – 3,984 total spectral samples
  • 🍏 Jazz Apple – 272 total spectral samples
  • 🍎 Plastic Apple – 6,693 total spectral samples
  • 🍎 Pink Lady Apple – 17,311 total spectral samples
  • 🍎 Royal Gala Apple – 21,319 total spectral samples
  • 🍅 Tomato – 3,748 total spectral samples
  • 🍅 Cherry Tomato – 360 total spectral samples
  • 🍅 Plastic Tomato – 569 total spectral samples
  • 🫑 Green Pepper – 226 total spectral samples
  • 🫑 Yellow Pepper – 4,752 total spectral samples
  • 🫑 Orange Pepper – 552 total spectral samples
  • 🍊 Orange – 4,641 total spectral samples
  • 🍊 Easy Peeler Orange – 2,720 total spectral samples
  • 🍐 Pear – 194 samples
  • 🍇 Green Grape – 106 total spectral samples
  • 🍋‍🟩 Lime – 43 total spectral samples

Download Instructions

Command Line

mkdir -p hyperspectral-fruit
huggingface-cli download LivingOptics/hyperspectral-fruit --repo-type dataset --local-dir hyperspectral-fruit

Python

from huggingface_hub import hf_hub_download
dataset_path = hf_hub_download(repo_id="LivingOptics/hyperspectral-fruit", filename="train", repo_type="dataset")
print(dataset_path)

Usage Example

import os.path as op
import numpy.typing as npt
from typing import List, Dict, Generator
from lo.data.tools import Annotation, LODataItem, LOJSONDataset, draw_annotations
from lo.data.dataset_visualisation import get_object_spectra, plot_labelled_spectra
from lo.sdk.api.acquisition.io.open import open as lo_open

# Load dataset
path_to_download = op.expanduser("~/Downloads/hyperspectral-fruit")
dataset = LOJSONDataset(path_to_download)

# Get training data iterator
training_data: List[LODataItem] = dataset.load("train")

# Inspect a few items
for lo_data_item in training_data[:3]:
    draw_annotations(lo_data_item)
    for ann in lo_data_item.annotations:
        print(ann.class_name, ann.category, ann.subcategories)

# Plot spectra for each class
fig, ax = plt.subplots(1)
object_spectra_dict = {}
class_numbers_to_labels = {0: "background_class"}
for lo_data_item in training_data:
    object_spectra_dict, class_numbers_to_labels = get_object_spectra(
        lo_data_item, object_spectra_dict, class_numbers_to_labels
    )
plot_labelled_spectra(object_spectra_dict, class_numbers_to_labels, ax)
plt.show()

AI studio

Generate PPTs instantly with Nano Banana Pro.

Generate PPT Now

Access Dataset

Login to Access

Please login to view download links and access full dataset details.

Topics

Hyperspectral Imaging
Image Processing

Source

Organization: huggingface

Created: 7/18/2024

Power Your Data Analysis with Premium AI Models

Supporting GPT-5, Claude-4, DeepSeek v3, Gemini and more.

Enjoy a free trial and save 20%+ compared to official pricing.