08 – YOLO, this AI is working for me part 2/2

Receipt to train an AI :

If you are in my case : Tracking a ball on video

  1. Acquire some data
    • In my case : Get a bunch of pictures of me swinging my drumsticks
  2. Annotate the data
    • In my case : Tel for each picture if there is a ball on the image and if there is one, its position on the image
    • This step is very important, how can one guess what we want him to guess if there is no way for him to know if he guessed right or not !
      The annotation quality is important to, the quality of the model you are training depend on it
  3. Train one or more model
    • This step require a bit of time and some computing power
    • There is many parameters to choose from, in my case, I will start the training from a YoloV3 model as told in my last post
  4. Profit !
    • Once the model is trained, you can test it to see how good it is, and then use it to detect the ball on the drumstick to play music !

Acquiring some data

The easiest step for me ! (it’s not always the case)
I just had to record me moving my drumsticks with the most diversity in mind.

If I want my model to perform well, I need to train him with pictures with no balls, with balls standing still and with balls moving very fast :

Very easy and very fun
But now my neighbours think I’m crazy

Annotating the data

I thought that this part of the process would be tedious, and I was right.
I had to tell for each images where the red ball was.
I couldn’t do it without the help of the wonderful online free tool :

roboflow

Sadly not sponsored

This tool that I have discovered it this tutorial was very handy because it allowed me to annotate and then directly train an AI !
for free

After annotating 217 images, I was ready to train my first model

Training a model

Thank to roboflow, this step was straight forward.
In just two clicks I started the training and had to wait less than 24h

If I wanted to train the model on your own like a chad, the process would have been way more complicated and some programming skills with a beefy PC is required.

Good for those who want to try it this way, the YOLO documentation is quite well done.

A nice thing with roboflow is that you can export the annotated images and their annotations, so it can be useful nonetheless.

Exploiting the model

Once the model is trained, roboflow allows you to test it directly in your browser :

However, the fast moving balls aren’t detected, and my computer isn’t powerful enough to run the model if a real-time a speed of more than 4ips making it hard to play hair drums…

So it turns out a poorly trained AI isn’t good enough for my project, but it was a good and fun experience nonetheless !

I hope this series of posts have make you learn a little bit more about AI and what we can make of it, until then, have fun doing the stuff you have fun doing !

By Tom Mansion

Really into creating stuff. Check my website for more info on the projects I have worked on

2 comments

    1. No, we have our ml course on another subject: reinforcement learning, but I’m glad I’m using it for a personal project (I also work with people that use it at work)

Leave a comment

Your email address will not be published. Required fields are marked *