Caltech-256

Task: Image Classification Classes: 257 Image Size: HxWx3

Overview

The Caltech-256 dataset is a large-scale image classification benchmark for single-label object recognition. It contains 257 object categories with at least 80 images per class, resulting in 30,607 images in total. The dataset contains a wide variety of objects and substantial variation in viewpoint, scale, lighting, and background. It does not provide an official train/test split, so this is left for the user to customize.

  • Total: 30,607 images across 257 classes

  • Classes: 257 object categories

Images have varying resolutions and aspect ratios. The dataset contains 30,185 RGB and 422 grayscale images, however all images have been converted to 3-channel RGB format.

../../_images/caltech256_teaser.png

Data Structure

When accessing an example using ds[i], you will receive a dictionary with the following keys:

Key

Type

Description

image

PIL.Image.Image

RGB image with maximum side length ≤ 7913 pixels

label

int

Class label in the range [0, 256]

Usage Example

Basic Usage

from stable_datasets.images.caltech256 import Caltech256

# Load training split (the only available split)
ds = Caltech256(split="train")

sample = ds[0]
print(sample.keys())  # {"image", "label"}

# Optional: make it PyTorch-friendly
ds_torch = ds.with_format("torch")

References

Citation

@article{griffin_holub_perona_2007,
    title = {Caltech-256 Object Category Dataset},
    publisher = {California Institute of Technology},
    author = {Griffin, Gregory and Holub, Alex and Perona, Pietro},
    year = {2007},
    month = {mar}
}