Learn to classify weather images using PyTorch CNN. Use the Multi-class Weather Dataset and explore the dataset structure, classes, and images.
import os
import torch
import torchvision
import tarfile
from torchvision.datasets.utils import download_url
from torch.utils.data import random_split
project_name='cnn-weather-image-classification'
For this assignmente the folowing dataset was used:
Multi-class Weather Dataset for Image Classification Published: 13-09-2018 | Version 1 | DOI: 10.17632/4drtyfjtfy.1 Contributor: Gbeminiyi Ajayi. Description. Multi-class weather dataset(MWD) for image classification is a valuable dataset used in the research paper entitled “Multi-class weather recognition from still image using heterogeneous ensemble method”. The dataset provides a platform for outdoor weather analysis by extracting various features for recognizing different weather conditions.
https://data.mendeley.com/datasets/4drtyfjtfy/1
The original dataset was modified for having a set of 32x32 images, and the same number of samples for each of four classes considered (cloudy, rain, shune and sunrise). This modified dataset can be downloaded from:
https://drive.google.com/file/d/13gxMPYy5saMKp4vrTnPdOb4VzSIRPvCf/view?usp=sharing
from google.colab import drive
drive.mount('/content/gdrive')
Drive already mounted at /content/gdrive; to attempt to forcibly remount, call drive.mount("/content/gdrive", force_remount=True).