Downloads and prepare the EuroSAT dataset from Hugging Face datasets. The dataset consists of Land Use and Land Cover Classification with Sentinel-2 satellite images. Images are openly and freely made available by the Earth observation program Copernicus. Images are organized into 10 classes.

eurosat_dataset(
  root,
  split = "train",
  download = FALSE,
  transform = NULL,
  target_transform = NULL
)

eurosat_all_bands_dataset(
  root,
  split = "train",
  download = FALSE,
  transform = NULL,
  target_transform = NULL
)

eurosat100_dataset(
  root,
  split = "train",
  download = FALSE,
  transform = NULL,
  target_transform = NULL
)

Arguments

root

(Optional) Character. The root directory where the dataset will be stored. if empty, will use the default rappdirs::user_cache_dir("torch").

split

Character. Must be one of train, val, or test.

download

Logical. If TRUE, downloads the dataset rows from the API if not already present.

transform

Function. Optional transformation to be applied to the images.

target_transform

Function. Optional transformation to be applied to the labels.

Value

A torch::dataset object named x and y with x, a 64x64 image with 3 or 13 layers, and y, the label .

Details

eurostat_dataset() provides a total of 27,000 RGB labeled images.

eurosat_all_bands_dataset() provides a total of 27,000 labeled images with 13 spectral channel bands.

eurosat100_dataset() provides a subset of 100 labeled images with 13 spectral channel bands, intended for workshops and demos.

Examples

if (FALSE) { # \dontrun{
# Initialize the dataset
ds <- eurosat100_dataset(split = "train", download = TRUE)

# Access the first item
head <- ds[1]
print(head$x) # Image
print(head$y) # Label
} # }