Load the Street View House Numbers data set in cropped digits format (Netzer et al., 2011). It consists of 32x32 RGB images in 10 classes. There are 73257 training images, 26032 test images, and 531131 extra images.


  • path: str. Path to directory which either stores file or otherwise file will be downloaded and extracted there. Filenames are train_32x32.mat, test_32x32.mat, extra_32x32.mat.
  • load_extra: bool, optional. Whether to load the extra images. Default is False.


Tuple of np.ndarray's (x_train, y_train), (x_test, y_test), and a third tuple of (x_extra, y_extra) if load_extra is True.

Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., & Ng, A. Y. (2011). Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning (Vol. 2011, p. 5).