v2.5.0
Datasets ⭐
EXAMPLE CODE
The Street View House Numbers (SVHN) Dataset
Load the SVHN dataset with one line of code. Stream SVHN while training models in PyTorch & TensorFlow. Visualize the dataset of Google Street View house numbers.
Visualization of SVHN Dataset on the Activeloop Platform

The Street View House Numbers (SVHN) Dataset

What is the SVHN Dataset?

The Street View Home Number (SVHN) dataset has 60,0000 32 x 32 RGB images of printed digits (from 0 to 9) clipped from photographs of house number plates. The trimmed photos are centered on the digit of interest while surrounding digits and other distractions are retained. Photos of house numbers in various countries from Google Street View, as well as input from Amazon Mechanical Turk (AMT) framework (used to identify and transcribe the single digits) was used to create the SVHN dataset.
In addition to the training and testing sets, SVHN also provides an additional set that is less challenging and may be used to assist in the training process. In all, the SVHN dataset provides an unbiased real-world picture dataset for machine learning and object recognition with little data preparation and formatting needed.

Download SVHN Dataset in Python

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

Load SVHN Dataset Training Subset in Python

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

Load SVHN Dataset Extra Subset in Python

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

Load SVHN Dataset Test Subset in Python

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

SVHN Dataset Structure

SVHN Data Fields

  • image: a tensor containing 32x32 images
  • boxes: a tensor to draw character-level bounding boxes around the digits.
  • labels: an integer between 0 to 9 representing digits.

SVHN Data Splits

  • SVHN training split comprises 73257 digits
  • SVHN testing split comprises 26032 digits
  • SVHN extra split comprises 531131 digits, these are comparatively less difficult samples, to use as extra training data.

How to use SVHN Dataset with PyTorch and TensorFlow in Python

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

1
dataloader = ds.tensorflow()
Copied!

Additional Information about SVHN Dataset

  • Paper: Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, Andrew Y. Ng Reading Digits in Natural Images with Unsupervised Feature Learning NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011. (PDF)
  • Point of Contact: [email protected]
  • Dataset Curators: Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, Andrew Y. Ng

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!

Citation Information

1
title={SVHN: Reading Digits in Natural Images with Unsupervised Feature Learning},
2
author={Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, Andrew Y. Ng }, Workshop={NIPS Workshop on Deep Learning and Unsupervised Feature Learning }
3
year={2011}
Copied!

SVHN Dataset FAQs

What is the SVHN dataset for Python?
The SVHN dataset is used for developing machine learning and object recognition algorithms with minimal requirements for data preprocessing and formatting. It contains real-world images has an order of magnitude more labeled data than the MNIST dataset. SVHN was created from house numbers in Google Street View images.
What is the SVHN dataset used for?
The Street View House Numbers (SVHN) dataset is used for creating machine learning and object recognition algorithms. It is a commonly used benchmark dataset as it needs minimal data preprocessing and formatting. MNIST's photos, for example, are cropped, but this dataset has an order of magnitude more labeled data (nearly 600,000 digit images) and is geared towards a far more difficult problem (recognizing digits and numbers in natural scene images).

How was the SVHN dataset generated?

The SVHN dataset was created by combining a large amount of Google Street View images by utilizing a combination of scripts and the Amazon Mechanical Turk, which helped localize, as well as transcribe the single digits. A large set of urban area house numbers from different countries was used in the sample.
How to download the SVHN dataset in Python?
With the open-source package Activeloop Hub, you can load the SVHN dataset with one line of code using Python. See detailed instructions on loading the SVHN dataset training subset and the SVHN dataset testing subset in Python.
How can I use SVHN dataset in PyTorch or TensorFlow?
The open-source package Activeloop Hub allows you to stream the SVHN dataset while training a model in TensorFlow or PyTorch with one line of code. See detailed instructions on how to train a model with PyTorch in Python or train a model on the SVHN dataset with TensorFlow in Python.