powered by
Loads the FER-2013 dataset for facial expression recognition. The dataset contains grayscale images (48x48) of human faces, each labeled with one of seven emotion categories: "Angry", "Disgust", "Fear", "Happy", "Sad", "Surprise", and "Neutral".
"Angry"
"Disgust"
"Fear"
"Happy"
"Sad"
"Surprise"
"Neutral"
fer_dataset( root = tempdir(), train = TRUE, transform = NULL, target_transform = NULL, download = FALSE )
A torch dataset of class fer_dataset. Each element is a named list:
fer_dataset
x: a 48x48 grayscale array
x
y: an integer from 1 to 7 indicating the class index
y
(string, optional): Root directory for dataset storage, the dataset will be stored under root/fer2013.
root/fer2013
Logical. If TRUE, use the training set; otherwise, use the test set. Not applicable to all datasets.
Optional. A function that takes an image and returns a transformed version (e.g., normalization, cropping).
Optional. A function that transforms the label.
Logical. If TRUE, downloads the dataset to root/. If the dataset is already present, download is skipped.
root/
The dataset is split into:
"Train": training images labeled as "Training" in the original CSV.
"Train"
"Training"
"Test": includes both "PublicTest" and "PrivateTest" entries.
"Test"
"PublicTest"
"PrivateTest"
Other classification_dataset: caltech_dataset, cifar10_dataset(), eurosat_dataset(), fgvc_aircraft_dataset(), flowers102_dataset(), mnist_dataset(), oxfordiiitpet_dataset(), tiny_imagenet_dataset()
caltech_dataset
cifar10_dataset()
eurosat_dataset()
fgvc_aircraft_dataset()
flowers102_dataset()
mnist_dataset()
oxfordiiitpet_dataset()
tiny_imagenet_dataset()
if (FALSE) { fer <- fer_dataset(train = TRUE, download = TRUE) first_item <- fer[1] first_item$x # 48x48 grayscale array first_item$y # 4 fer$classes[first_item$y] # "Happy" }
Run the code above in your browser using DataLab