v2.5.0
Datasets ⭐
EXAMPLE CODE
USPS Dataset
Load USPS in Python with one line of code. USPS is a handwriting recognition dataset. Stream the USPS dataset while training models in Pytorch and Tensorflow.
Visualization of USPS dataset on the Activeloop Platform

USPS dataset

What is USPS Dataset?

The USPS dataset showcases a broad range of font styles. The dataset was made by automatically scanning envelopes by the U.S. Postal Service. The dataset consists of 9,298 16×16 pixel grayscale samples. Each image in the dataset is centered and normalized.

Download USPS Dataset in Python

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

Load USPS Dataset Training Subset in Python

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

Load USPS Dataset Testing Subset in Python

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

USPS Dataset Structure

USPS Data Fields

  • images: tensor containing the image.
  • labels: tensor to represent image label categories.

USPS Data Splits

How to use USPS Dataset with PyTorch and TensorFlow in Python

Train a model on USPS 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 USPS dataset with TensorFlow in Python

1
dataloader = ds.tensorflow()
Copied!

Additional Information about USPS Dataset

USPS Dataset Description

USPS Dataset Curators

J. J. Hull

USPS 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!

USPS Dataset Citation Information

1
@ARTICLE{291440,
2
author={Hull, J.J.},
3
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence},
4
title={A database for handwritten text recognition research},
5
year={1994},
6
volume={16},
7
number={5},
8
pages={550-554},
9
doi={10.1109/34.291440}}
Copied!

USPS Dataset FAQs

What is the USPS dataset for Python?

The USPS dataset is often used in computer vision, pattern recognition, and handwritten text recognition research. USPS is often used as a benchmark dataset as it showcases a broad range of font styles. Also, the images in the dataset are 16×16 pixel grayscale samples, and each image in the dataset is centered and normalized.
How to download the USPS dataset in Python?
You can load USPS dataset fast with one line of code using the open-source package Activeloop Hub in Python. See detailed instructions on how to load USPS dataset training subset and testing subset in Python.

How can I use the USPS dataset in PyTorch or TensorFlow?

You can stream the USPS dataset while training a model in PyTorch or TensorFlow with one line of code using the open-source package Activeloop Hub in Python. See detailed instructions on how to train a model on USPS dataset with PyTorch in Python or train a model on USPS dataset with TensorFlow in Python.