Learn practical skills, build real-world projects, and advance your career
!pip install jovian --upgrade --quiet
import os
import torch
import torchvision
import tarfile
import torch.nn as nn
import numpy as np
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 matplotlib
import matplotlib.pyplot as plt
%matplotlib inline

matplotlib.rcParams['figure.facecolor'] = '#ffffff'
project_name = 'project: image-classification'
#download the dataset
dataset_url = "https://s3.amazonaws.com/fast-ai-imageclas/imagewoof-160.tgz"
download_url(dataset_url, '.')

# extract the archive

with tarfile.open('./imagewoof-160.tgz', 'r:gz') as tar: #read file in r mode
  tar.extractall(path = './data')
Using downloaded and verified file: ./imagewoof-160.tgz

Exploring Dataset

This dataset consists of 2 folders named as train and val. Each of them contains 10 folders, one for each class of images.