Dog Detector
Table of Contents
Introduction
As part of the Dog-Breed Classification application I want to be able to detect whether an image has a dog or a human. This post will use pre-trained models to detect dogs in images.
Set Up
Imports
From PyPi
import torchvision.models as models
VGG-16
My first model will be a pre-trained VGG-16 model that has weights that wer trained on the ImageNet data set. ImageNet contains over 10 million URLs which link to an image containing an object from one of 1000 categories.
Build the Model
VGG16 = models.vgg16(pretrained=True)
VGG16.eval()
VGG16.to(device)