Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
Graphic Content Prediction using Transfer Learning
I'll be using resnet34 to make an Image classifier to predict whether it is a graphic content or not.
First of all I've mounted my drive: because I have scrapped animal slaughtering images and random images using python requests module from links on the internet.
from google.colab import drive
drive.mount('/content/drive')
Drive already mounted at /content/drive; to attempt to forcibly remount, call drive.mount("/content/drive", force_remount=True).
Before we go anywhere Importing libraries are always the first priority :D
import os
import torch
import torchvision
import tarfile
from torchvision.datasets.utils import download_url
from torch.utils.data import random_split
from tqdm.notebook import tqdm