The main script will be responsible for the complete logic of the app. It will process a video stream and use an object-detection deep convolutional neural network combined with the tracking algorithm that we will prepare later in this chapter.
The algorithm is used to track objects from frame to frame. It will also be responsible for illustrating results. The script will accept arguments and have some intrinsic constants, which are defined in the following initialization steps of the script:
- As with any other script, we start by importing all the required modules:
import argparse
import cv2
import numpy as np
from classes import CLASSES_90
from sort import Sort
We will use argparse as we want our script to accept arguments. We store the object classes in a separate file in order not to contaminate our script. Finally, we import our Sort tracker, which...