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)
Built Distribution
Close
Hashes for tinyimagenet-0.9.9-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 941c7d3b19cb2f3fa719799530745a3cc0e7095a1990f2f5be107d355ec359df |
|
MD5 | d478384db7781856589d74fdf29825e0 |
|
BLAKE2b-256 | 5d0791f5937864082de49f5c32d2d79983829d38a1b911f5e0dc719e8cf16eb1 |