v2.5.0
Datasets ⭐
EXAMPLE CODE
Stanford Cars Dataset
Visualize the Stanford Cars dataset. Load the Stanford Cars dataset in seconds with Python and stream data while training models in PyTorch & TensorFlow.
Visualization of Stanford Cars Dataset on the Activeloop Platform

Stanford Cars Dataset

What is Stanford Cars Dataset?

The Stanford Cars dataset is developed by Stanford University AI Lab specifically to create models for differentiating car types from each other.
Among 196 car classes covered by the Stanford Car dataset, 16,185 images have been collected from the rear of each car. The images are divided almost 50-50 between training and scoring, with 8,144 training images and 8,041 scoring images. Categories are typically at the make, model, year level.

Download Stanford Cars Dataset in Python

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

Load Stanford Cars Dataset Training Subset in Python

1
import hub
2
ds = hub.load("hub://activeloop/stanford-cars-train")
Copied!

Load Stanford Cars Dataset Testing Subset in Python

1
import hub
2
ds = hub.load("hub://activeloop/stanford-cars-test")
Copied!

Stanford Cars Dataset Structure

Stanford Cars Data Fields

  • image: a tensor containing cars images.
  • car model: a class label tensor to classify images into 196 classes of cars.
  • boxes: a tensor array to draw bounding boxes around the object of interest

Stanford Cars Data Splits

  • Stanford Cars training split comprises 8144 images.
  • Stanford Cars testing split comprises 8041 images.

How to use Stanford Cars Dataset with PyTorch and TensorFlow in Python

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

1
dataloader = ds.tensorflow()
Copied!

Additional Information about Stanford Cars Dataset

Licensing Information

This dataset has a license similar to the ImageNet license.
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={3D Object Representations for Fine-Grained Categorization},
2
author={Jonathan Krause, Michael Stark, Jia Deng, Li Fei-Fei},
3
journal={4th IEEE Workshop on 3D Representation and Recognition, at ICCV 2013 (3dRR-13)},
4
year={2013}
Copied!

Stanford Cars Dataset FAQs

What is the Stanford Cars dataset for Python?

The Stanford Cars dataset contains a total of 16,185 images that are categorized into 196 classes of cars. The data contains 8,144 training images and 8,041 testing images. The classes in the dataset are usually at the level of Make, Model, Year.

What is the Stanford Cars dataset used for?

The Stanford Cars dataset has several use cases such as building vehicle recognition predictive models and classifying car models.

How to download the Stanford Cars dataset in Python?

Load the Stanford Cars dataset with one line of code using Activeloop Hub the open-source package made in Python. Check out detailed instructions on how to load the Stanford Cars dataset training subset in Python or load the Stanford Cars dataset testing subset in Python.

How can I use the Stanford Cars dataset in PyTorch or TensorFlow?

You can train a model on Stanford Cars dataset with PyTorch in Python or train a model on the Stanford Cars dataset with TensorFlow in Python. You can stream the Stanford Cars dataset while training a model in PyTorch or TensorFlow with one line of code using the open-source package Activeloop Hub that is written in Python.