Table of Contents

Build an AI Real-Time Nose Tracking App Using Face Detection in PictoBlox Junior Blocks

Example Description
Learn how to use the Face Detection AI extension in PictoBlox Junior Blocks to make a ball sprite follow the tip of your nose in real time through the camera, demonstrating live facial landmark tracking using machine learning.

Introduction 

We are going to build AI-powered nose tracking in PictoBlox! The aim of the project is to use a ball to track your nose! We are going to use the Face Detection extension to make this work. By tracking your movements in real-time, the ball will follow you wherever your nose goes. You’ll need to move your face anywhere; the ball will track your nose. 

Let’s make Nose Tracking using a ball in Junior Blocks.

  1. Add the Ball sprite in the sprite library. Click the ‘choose a sprite> use the search to find the ball > select the ball.
  2. Click the delete icon on top of the Tobi sprite. In the code, we are not going to use Tobi in this example.
  3. Now it’s time to add the backdrop for this example. Click the backdrop icon below the sprite option (bottom right corner) > Search Neon Tunnel > Select the backdrop.First, let’s set up:
  4. Click ‘Add Extension‘ and pick Face Detection.

    Building the Nose Tracking Code

  5. Go to Events and drag the Green Flag block into your coding area.
  6. Add the camera switch block from the face detection extension. It enables or opens the PictoBlox camera in the stage.
  7. From Controls, drag in a Repeat Forever block.
  8. Once the camera opens, the face needs analysis to identify the nose. If you are adding only an analysis block, it will show the rectangle box in your face. Let’s see to it, to how to make it possible.
  9. Inside the Repeat Forever blocks, 
  10. Add the Analysis Image block from the Face Detection extension. 
  11. For more specificity to your nose, add the Move with Face block and select the Nose icon to change.
  12. Now let’s click the Flag icon to track your nose.

Output