v2.5.0
Datasets ⭐
EXAMPLE CODE
FER2013 Dataset
Load FER2013 in Python fast. 48x48 pixel grayscale images with seven different emotions. Stream FER2013 while training models in PyTorch and TensorFlow.
Visualization of FER2013 Dataset on the Activeloop Platform

FER2013 Dataset

What is FER2013 Dataset?

The FER2013 (Facial Expression Recognition 2013) dataset contains images along with categories describing the emotion of the person in it. The dataset contains 48x48 pixel grayscale images with 7 different emotions such as Angry, Disgust, Fear, Happy, Sad, Surprise, and Neutral. The dataset contains 28709 examples in the training set, 3589 examples in the public testing set, and 3589 examples in the private test set.

Downloading FER2013 Dataset in Python

Instead of downloading the FER2013 in Python, you can effortlessly load it in Python via our open-source package Hub with just one line of code.

Load FER2013 Train Dataset Subset in Python

1
import hub
2
ds = hub.load('hub://activeloop/fer2013-train')
Copied!

Load FER2013 Public Test Dataset Subset in Python

1
import hub
2
ds = hub.load('hub://activeloop/fer2013-public-test')
Copied!

Load FER2013 Private Test Dataset Subset in Python

1
import hub
2
ds = hub.load('hub://activeloop/fer2013-private-test')
Copied!

FER2013 Dataset Structure

Data Fields

  • images: tensor containing the image
  • labels: tensor containing labels of an corresponding image

How to use FER2013 Dataset with PyTorch and TensorFlow in Python

Train a model on FER2013 dataset with PyTorch in Python

Let's use Hub's built-in PyTorch one-line dataloader to connect the data to the compute:
1
dataloader = ds.pytorch(num_workers=0, batch_size=4, shuffle=False)
Copied!

Train a model on FER2013 dataset with TensorFlow in Python

1
dataloader = ds.tensorflow()
Copied!

Additional Information about FER2013 Dataset

FER2013 Dataset Description

FER2013 Dataset Contributors

Pierre-Luc Carrier and Aaron Courville

FER2013 Dataset Licensing Information

Hub users may have access to a variety of publicly available datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have a license to use the datasets. It is your responsibility to determine whether you have permission to use the datasets under their license.
If you're a dataset owner and do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thank you for your contribution to the ML community!