If you are interested in learning how our model was trained and want to try it training it yourself, you can follow these steps.
Before you begin, you'll need the following:
-
A Snapchat mobile app and account.
-
Lens Studio - Download Lens Studio.
-
FFmpeg - Install
FFmpeg
. You can usehomebrew
to install it easily.brew install ffmpeg
Download the sample Lens Studio project to record the videos we will use to train a custom model.
- Open up the sample project in Lens Studio.
- Duplicate the symbols into 4 objects and place them around the scene.
- Pair your phone to Lens Studio with the Snapchat app and press the "Push Lens To Device" button.
-
With the Snapchat app, capture a few 10-second videos in different environments (grass, concrete, etc). You can scale up and down the symbols with "pinch-and-zoom."
-
Download the videos to your computer and use FFmpeg commands to split the videos into frames. Depending on the length of your video, you will end up with around 100-200 images.
ffmpeg -i [NAME_OF_YOUR_TRAINING_VIDEO.mp4] -vf fps=4 trainingvideo_out%d.jpg
-
Next up, we will use the images to train our model.
Follow the steps in this tutorial to create the model. Once finished, download the model_web
folder to your computer.
Replace the the model_web
folder in the tello-demo/public
directory. Afterwards, follow the instructions here to test it out!