Skip to main content

TinyImageNet dataset for PyTorch

Project description

tiny-imagenet-torch

A PyTorch-compatible implementation of the TinyImageNet dataset, following the pattern of torchvision datasets like MNIST, FashionMNIST, and CIFAR-10.

About TinyImageNet

Tiny ImageNet contains 100000 images of 200 classes (500 for each class) downsized to 64×64 colored images. Each class has 500 training images, 50 validation images and 50 test images. More information can be found here: https://paperswithcode.com/dataset/tiny-imagenet. This implementation ingores the unlabeled test images to match the structure of MNIST, FashionMNIST, and CIFAR-10.

Installation

pip install tiny-imagenet-torch

Or install from source:

git clone https://github.com/ligerlac/tiny-imagenet-torch.git
cd tiny-imagenet-torch
pip install -e .

Usage

import torch
from torch.utils.data import DataLoader
from torchvision import transforms
from tiny_imagenet_torch import TinyImageNet

# Simple transformation - just convert to tensor
transform = transforms.ToTensor()

# Create dataset
train_dataset = TinyImageNet(
    root='./data',
    train=True,
    download=True,
    transform=transform
)

test_dataset = TinyImageNet(
    root='./data',
    train=False,
    download=True,
    transform=transform
)

# Create data loaders
train_loader = DataLoader(train_dataset, batch_size=128, shuffle=True, num_workers=4)
test_loader = DataLoader(test_dataset, batch_size=128, shuffle=False, num_workers=4)

# Usage example
for images, labels in train_loader:
    # Your training code here
    pass

Dataset Details

  • 200 classes from ImageNet
  • 500 training images per class (100,000 total)
  • 50 validation images per class (10,000 total)
  • All images are 64×64 color images

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • The TinyImageNet dataset was created by Stanford for the CS231N course
  • The implementation follows torchvision's dataset pattern

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

tiny_imagenet_torch-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tiny_imagenet_torch-0.1.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file tiny_imagenet_torch-0.1.0.tar.gz.

File metadata

  • Download URL: tiny_imagenet_torch-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for tiny_imagenet_torch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 35d3a9f53af3b32e040fd8c4797022e344f1995298c781090993ce81ef4bafe8
MD5 1480bd70c24fc93ff362267a0c81bd7f
BLAKE2b-256 d84c52cb00bf606fdbdf24255e7f5809c909c93df70afd1aa987851fffccdd29

See more details on using hashes here.

File details

Details for the file tiny_imagenet_torch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for tiny_imagenet_torch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17a975d07ffeac2cc03f8a4532ca32ac20c056a23c7f6b0764b18921bae7cddc
MD5 bb87d8ddccaa8e16e401b96ba790b891
BLAKE2b-256 d97678c9c3bfdb8488a8c7ee48d0b2515680d7e0301fdfd407daed43e1901bf5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page