% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dataset-vggface2.R
\name{vggface2_dataset}
\alias{vggface2_dataset}
\title{VGGFace2 Dataset}
\usage{
vggface2_dataset(
  root = tempdir(),
  split = "val",
  transform = NULL,
  target_transform = NULL,
  download = FALSE
)
}
\arguments{
\item{root}{Character. Root directory where the dataset will be stored under \code{root/vggface2}.}

\item{split}{One of \code{"train"}, \code{"val"}, or \code{"test"}. Default is \code{"val"}.}

\item{transform}{Optional. A function that takes an image and returns a transformed version (e.g., normalization, cropping).}

\item{target_transform}{Optional. A function that transforms the label.}

\item{download}{Logical. If TRUE, downloads the dataset to \verb{root/}. If the dataset is already present, download is skipped.}
}
\value{
A torch dataset object \code{vggface2_dataset}:
\itemize{
\item \code{x}: RGB image array.
\item \code{y}: Integer label (1…N) for the identity.
}

\code{ds$classes} is a named list mapping integer labels to a list with:
\itemize{
\item \code{name}: Character name of the person.
\item \code{gender}: "Male" or "Female".
}
}
\description{
The VGGFace2 dataset is a large-scale face recognition dataset containing images
of celebrities from a wide range of ethnicities, professions, and ages.
Each identity has multiple images with variations in context, pose, age, and illumination.
}
\examples{
\dontrun{
#Load the training set
ds <- vggface2_dataset(download = TRUE)
item <- ds[1]
item$x      # image array RGB
item$y      # integer label
ds$classes[item$y]  # list(name=..., gender=...)

#Load the test set
ds <- vggface2_dataset(download = TRUE, train = FALSE)
item <- ds[1]
item$x      # image array RGB
item$y      # integer label
ds$classes[item$y]  # list(name=..., gender=...)
}

}
\seealso{
Other classification_dataset: 
\code{\link{caltech_dataset}},
\code{\link{cifar10_dataset}()},
\code{\link{eurosat_dataset}()},
\code{\link{fer_dataset}()},
\code{\link{fgvc_aircraft_dataset}()},
\code{\link{flowers102_dataset}()},
\code{\link{image_folder_dataset}()},
\code{\link{lfw_dataset}},
\code{\link{mnist_dataset}()},
\code{\link{oxfordiiitpet_dataset}()},
\code{\link{places365_dataset}()},
\code{\link{tiny_imagenet_dataset}()},
\code{\link{whoi_plankton_dataset}()},
\code{\link{whoi_small_coralnet_dataset}()}
}
\concept{classification_dataset}
