100 Days Of ML Code — Day 061

Recap From Day 060
Day 060, we looked at working with time; tradeoffs of classifiers other than kNN. We saw that one of the biggest challenges in creating a good HMM is to set all of the parameters of the probability distributions. Like in Naive Bayes, it’s the training process that sets these probabilities from the data, hopefully in a reasonable way. But with so many parameters that need to be set, Hidden Markov Models can require a very large amount of data to be trained well.
Today, we will look at using Wekinator to control a drum machine with a webcam.
Using Wekinator to control a drum machine with a webcam
In the past 60 days, we’ve looked at so many machine learning algorithms, audio features and video features. But we’ve not really seen any demo. Today, I will show you how to use a webcam to control a drum machine using a classifier in Wekinator. For those here form the beginning, we’ve already learned a lot about Wekinator. If you don’t know about Wekinator, you can get up to speed using the links below.
Things we need
Launch the webcam extractor, Wekinator and the drum program. Using the 10 by 10 grid webcam extractor from the link above, we will send 100 inputs to port 6448, where Wekinator can listen for them.

With Wekinator opened, supply “100” as values for the inputs field highlighted in red as seen in the image below.

Since we want to control one drum sound, the output field should be supplied with “1” as it’s input value as shown below.

We are going to control our drum machine using a classifier. For that reason, select “All classifiers (default setting)” from the type drop-down menu as shown below.

After setting the Type to “All classifiers (default setting)”, input “4” as the value for “with class” text box as shown below since we want to play one of four set of drums.

So, once you put 100 as value for inputs, 1 as value for output, “All classifiers (default setting)” as value for type and 4 as value for with class as shown below, click next and you’re good to go.

After clicking next, Wekinator will take you to another page where you can start recording your training examples. Below is the official video from Wekinator, that demonstrates how to do that.
That’s all for day 061. I hope you found this informative. Thank you for taking time out of your schedule and allowing me to be your guide on this journey. And until next time, be legendary.
