Skip to main content

Dataset class for PyTorch and the TinyImageNet dataset, with automated download and extraction.

Project description

torchvision-tinyimagenet

Dataset class for PyTorch and the TinyImageNet dataset.

Installation

pip install tinyimagenet

How to use

from tinyimagenet import TinyImageNet
from pathlib import Path
import logging

logging.basicConfig(level=logging.INFO)

split ="val"
dataset = TinyImageNet(Path("~/.torchvision/tinyimagenet/"),split=split)
n = len(dataset)
print(f"TinyImageNet, split {split}, has  {n} samples.")
n_samples = 5
print(f"Showing info of {n_samples} samples...")
for i in range(0,n,n//n_samples):
    image,klass = dataset[i]
    print(f"Sample of class {klass:3d}, image {image}, words {dataset.idx_to_words[klass]}")

You can also check the quickstart notebook to peruse the dataset.

Finally, we also provide some example notebooks that use TinyImageNet with PyTorch models:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinyimagenet-0.9.9.tar.gz (11.3 kB view hashes)

Uploaded Source

Built Distribution

tinyimagenet-0.9.9-py2.py3-none-any.whl (9.2 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page