Caltech-256 Dataset

caltech256_detection_dataset(
  root = tempdir(),
  transform = NULL,
  target_transform = NULL,
  download = FALSE
)

Arguments

root

Character. Root directory for dataset storage. The dataset will be stored under root/caltech256.

transform

Optional function to apply to each image after loading (e.g., resizing, normalization).

target_transform

Optional function to transform the target label.

download

Logical. If TRUE, downloads and extracts the dataset if it's not already present. Default is FALSE.

Value

An object of class caltech256_detection_dataset, which behaves like a torch dataset. Each element is a named list:

x

A 3 x W x H integer array representing an RGB image.

y

A character string representing the class label.

Details

Loads the Caltech-256 Object Category Dataset, which consists of 30,607 images from 256 distinct object categories. Each category has at least 80 images, with significant variability in object position, scale, and background. #'

Examples

if (FALSE) { # \dontrun{
caltech256 <- caltech256_detection_dataset(download = TRUE)

first_item <- caltech256[1]
first_item$x  # Image array
first_item$y  # Class label, e.g., "ak47"
} # }