To run our app, we will need to execute the main function routine (in chapter6.py). This loads the data, trains the classifier, evaluates its performance, and visualizes the result:
- First, we need to import all the relevant modules and set up the main function, as follows:
import cv2
import numpy as np
import matplotlib.pyplot as plt
from data.gtsrb import load_training_data
from data.gtsrb import load_test_data
from data.process import grayscale_featurize, hog_featurize
- Then, the goal is to compare classification performance across feature extraction methods. This includes running the task using a list of different feature extraction approaches. So, we first load the data, and repeat the process for each of the featurizing functions, as follows:
def main(labels):
train_data, train_labels = load_training_data(labels)
test_data, test_labels = load_test_data...