March 2020
Intermediate to advanced
366 pages
9h 8m
English
We will store the data once the user clicks on the Take Snapshot button, and the _on_snapshot event listener method is called, as shown in the following code block:
def _on_snapshot(self, evt): """Takes a snapshot of the current frame This method takes a snapshot of the current frame, preprocesses it to extract the head region, and upon success adds the data sample to the training set. """
Let's take a look at the code inside this method, as follows:
if self.neutral.GetValue(): label = 'neutral' elif self.happy.GetValue(): label = 'happy' elif self.sad.GetValue(): label = 'sad' elif self.surprised.GetValue(): ...