Classifying images with GoogleNet/Inception and ResNet models
In computer vision, a classification task is the estimation of the probability that an input image belongs to a particular category. In other words, the algorithm must determine the category for the image and the main goal is to create a classifier with the lowest number of errors. Classification tasks first gave deep learning algorithms an edge over other algorithms. Since then, Deep Learning has gained huge interest from many scientists and engineers. In this recipe, we will apply three models with different architectures to the classification task.
Getting ready
Before you proceed with this recipe, you need to install the OpenCV 3.3.1 Python API package.
How to do it...
You need to follow these steps:
- Import the modules:
import cv2 import numpy as np
- Define a
classify
function, which gets frames from the video, transforms them into tensors, feeds them to the neural network, and selects five categories with the highest probability...