Learn practical skills, build real-world projects, and advance your career

CIFAR 100 Image Classification

This dataset contains 100 different classes of image. Each classes contain 500 other images therefore we can say the data is properly organised. All images are of 3 channels of dimensions 32 x 32 . We will be applying different Deep Learning approaches to get the best outputs from this dataset.

!pip install opendatasets --upgrade -q
!pip install jovian --upgrade -q
import os
import torch
import torchvision
import tarfile
import torch.nn as nn
import numpy as np
import os
import torch.nn.functional as F
from torchvision.datasets.utils import download_url
from torchvision.datasets import ImageFolder
from torch.utils.data import DataLoader
import torchvision.transforms as tt
from torch.utils.data import random_split
from torchvision.utils import make_grid
import torchvision.models as models
import matplotlib.pyplot as plt
import opendatasets as od
%matplotlib inline
dataset_url = 'https://www.kaggle.com/minbavel/cifar-100-images'
od.download(dataset_url)
Please provide your Kaggle credentials to download this dataset. Learn more: http://bit.ly/kaggle-creds Your Kaggle username: tanujkumarcodex Your Kaggle Key: ··········
0%| | 0.00/140M [00:00<?, ?B/s]
Downloading cifar-100-images.zip to ./cifar-100-images
100%|██████████| 140M/140M [00:01<00:00, 81.3MB/s]

How to get Kaggle Key and Username?

  1. Sign in to https://kaggle.com/, then click on your profile picture on the top right and select "My Account" from the menu
  2. Scroll down to the "API" section and click "Create New API Token". This will download a file kaggle.json with the following contents: {"username":"YOUR_KAGGLE_USERNAME","key":"YOUR_KAGGLE_KEY"}
  3. When you run opendatsets.download, you will be asked to enter your username & Kaggle API, which you can get from the file downloaded in step 2.