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
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.tar.gz
(9.7 kB
view hashes)
Built Distribution
Close
Hashes for tinyimagenet-0.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7cd66733f9bc9eefa2e43529e656a5c220ee52ad8327d21c6bd4c0e7fd3a50c8 |
|
MD5 | 984d001cdd3486c7df474bc640534fa7 |
|
BLAKE2b-256 | 6c4008bf3c27acdb2e8796b07b51a6c407f4da17d1ac84f58a0031e89d272831 |