SkillAgentSearch skills...

Tinyimagenet

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

Install / Use

/learn @facundoq/Tinyimagenet
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

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,imagenet_idx=False)
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]}")

The imagenet_idx indicates if the dataset's labels correspond to those in the full ImageNet dataset. By default (imagenet_idx=False) the labels are renumbered sequentially so that the 200 classes are named 0, 1, 2, ..., 199.

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

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

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated2mo ago
Forks0

Languages

Python

Security Score

85/100

Audited on Jan 26, 2026

No findings