As we can see we need to give two parameters that are the pre-trained model and de caffe deploy.
Explaining the code.
First we need to import the packages that we are going to use
# import the necessary packages
from imutils.video import VideoStream
from imutils.video import FPS
import numpy as np
import argparse
import imutils
import time
import cv2
Initialice the parameters that we are going to use
Caffe deploy
Caffe pre-trained model
Give the list of object that our MobileNet SSD was trained, and create rectangles to introduce to the frame when a object is detected.
Initialize the serialized model and the video stream.
Take the frame and resize it to 400 pixels and then covert it to a blob file.
*This width is define to optimize our code.
GIve the blob file to the network so it can start predicting
Start looping over the detections that we get, then we extract them and associate with the prediction.
We guarantee that the detections are greater than the minium of confidence.
Then we star to get the index of the class label from the array that we defin, so we could start paintin the boxes around the objects