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 details)
Built Distribution
File details
Details for the file tinyimagenet-0.9.9.tar.gz
.
File metadata
- Download URL: tinyimagenet-0.9.9.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcbd21749abc63138fedf213501fd509c3e8495f2e78b8af5492338f876cc07a |
|
MD5 | 90dd492af4bcc614cca0da96ead70b83 |
|
BLAKE2b-256 | 1e79a9284fd961664d6c23a4f85ca6ee7db82273f37d61cd7317bab83e4b223f |
File details
Details for the file tinyimagenet-0.9.9-py2.py3-none-any.whl
.
File metadata
- Download URL: tinyimagenet-0.9.9-py2.py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 941c7d3b19cb2f3fa719799530745a3cc0e7095a1990f2f5be107d355ec359df |
|
MD5 | d478384db7781856589d74fdf29825e0 |
|
BLAKE2b-256 | 5d0791f5937864082de49f5c32d2d79983829d38a1b911f5e0dc719e8cf16eb1 |