Datasets:
File size: 1,474 Bytes
77c8f95 9777360 c481ade a142f18 a2be8e4 9a36bfc ac376f1 a2be8e4 15566de a2be8e4 65cede8 a2be8e4 ab2f8fe a2be8e4 ab2f8fe a2be8e4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
---
task_categories:
- image-classification
size_categories:
- 100K<n<1M
---
[CINIC10](https://github.com/BayesWatch/cinic-10) dataset with interface of [CIFAR10](https://github.com/pytorch/vision/blob/main/torchvision/datasets/cifar.py).
It is faster than the common CINIC10 due to the fact that all images are loaded into RAM while initing dataset instance.
You should save `cinic10.py` from this repo in local directory. And then import the CINIC10 class from it:
```
import torchvision
import torch
from torchvision transforms
from cinic10 import CINIC10
data_mean = [0.47889522, 0.47227842, 0.43047404]
data_std = [0.24205776, 0.23828046, 0.25874835]
transform_train = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.Resize(32),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(data_mean, data_std),
])
transform_test = transforms.Compose([
transforms.Resize(32),
transforms.ToTensor(),
transforms.Normalize(data_mean, data_std),
])
batch_size = 64
num_workers = 4
trainset = CINIC10(root='./data', train=True, download=True, transform=transform_train)
trainloader = torch.utils.data.DataLoader(trainset, batch_size=batch_size, shuffle=True, num_workers=num_workers)
testset = CINIC10(root='./data', train=False, download=True, transform=transform_test)
testloader = torch.utils.data.DataLoader(testset, batch_size=batch_size, shuffle=False, num_workers=num_workers)
```
|