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.
How to use
from tinyimagenet import TinyImageNet
import logging
from pathlib import Path
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]}")
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.3.tar.gz
(5.1 kB
view hashes)
Built Distribution
Close
Hashes for tinyimagenet-0.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5dc8966197c0079a2d7e9617421230652c59304373848e72e3d8a2ca82feaeef |
|
MD5 | d07289850d5fb61cb1cc74e88db4551a |
|
BLAKE2b-256 | bcfe5c5d006f52b033a0604815f0a74eb181f0d0c0c61e99d739a292f14a85e3 |