March 2020
Intermediate to advanced
366 pages
9h 8m
English
Analogous to some of the previous chapters, the GUI of the app is a customized version of the generic BaseLayout, as shown in the following code block:
import wxfrom wx_gui import BaseLayoutclass DataCollectorLayout(BaseLayout):
We start building the GUI by calling the constructor of the parent class to make sure it's correctly initialized, like this:
def __init__(self, *args, training_data='data/cropped_faces.csv', **kwargs): super().__init__(*args, **kwargs)
Notice that we have added some extra arguments in the previous code. Those are for all extra attributes that our class has and that the parent class doesn't.
Next, before we go on to adding UI components, we also initialize a FaceDetector instance ...