Class 6 - Coding, AI & Robotics Course
-
Coding
Session 1: Introduction to Coding3 Topics -
Session 2: Backdrop, Costume, and Animation3 Topics|1 Quiz
-
Session 3: Basics of Algorithm and Flowchart3 Topics|1 Quiz
-
Session 4: Basics of Pseudocode3 Topics|1 Quiz
-
Session 5: Getting Started with Quarky3 Topics|1 Quiz
-
Session 6: Variables: The Multitaskers4 Topics|1 Quiz
-
Session 7: Arithmetic Operators4 Topics|1 Quiz
-
Session 8: Conditional Statements3 Topics|1 Quiz
-
Session 9: Logical Operators4 Topics|1 Quiz
-
Session 10: Nested Conditional Statements2 Topics|1 Quiz
-
Session 11: Loops3 Topics|1 Quiz
-
Session 12: Touch Based Piano2 Topics
-
Session 13: Criterial in Loops5 Topics|1 Quiz
-
Session 14: Catch the Fruit Game - Part 12 Topics
-
Session 15: Catch the Fruit Game - Part 22 Topics|1 Quiz
-
Artificial IntelligenceSection 16: Introduction to Artificial Intelligence3 Topics|1 Quiz
-
Session 17: Basics of Face Detection2 Topics|1 Quiz
-
Session 18: Face Expression Detection2 Topics|1 Quiz
-
Session 19: Mimic Face with Quarky1 Topic
-
Session 20: Face Filter - Part 12 Topics
-
Session 21: Face Filter - Part 22 Topics
-
RoboticsSession 22: Basics of Robotics2 Topics|1 Quiz
-
Session 23: Wirelessly Controlled Robot2 Topics
-
Session 24: Introduction to Sensors3 Topics|1 Quiz
-
Session 25: Introduction to Actuators3 Topics|1 Quiz
-
Session 26: Face Tracking with Robot2 Topics
-
Session 27: Obstacle Avoidance Robot - Part 13 Topics
-
Session 28: Obstacle Avoidance Robot - Part 22 Topics|1 Quiz
-
Session 29: Edge Detector Robot - Part 13 Topics
-
Session 30: Edge Detector Robot - Part 22 Topics|1 Quiz
-
Capstone ProjectCapstone Project
Activity: Making an Expression Mimic Bot
Making an Expression Detector – Overview
In this activity, we’re going to make an expression detector using Quarky. In the first part, we’re going to make a script in PictoBlox to detect our expression using the camera.
In the next part, we’re going to make a script to make Quarky mimic those expressions.
Let’s get started.
Let’s Code!
First, we’re going to make a script to detect the expressions.
Detecting the Face
Follow the steps below to detect expression in PictoBlox:
- Open PictoBlox and create a New File.
- Select the coding environment as Block Coding.
- Add a when flag clicked block from the Events palette into the scripting area. Now, we need to turn on the camera of our device be it laptop/desktop or smartphone so that PictoBlox can detect our expression. For that, we’ll need the Face Detection extension.
- To add the Face Detection extension, click the purple-colored Add Extension button in the bottom-left corner of the screen.
Then, select the Face Detection extension to add it to your palette.
- Add a turn () video on the stage with () % transparency block below the when flag clicked block. The default option is on and the transparency is 0%.
- Add a () bounding box block below the turn () video on the stage with () % transparency block. The default option is to show the box. This block will track our face wherever we move it.
- Add a forever block from the Control palette below the () bounding box block. Only the blocks inside the forever block will run continuously.
- Add an analyse image from () block inside the forever block. This block will analyse our faces to detect our expressions.
- Now, we’re going to make Tobi tell the expression that PictoBlox has detected. From the Looks palette, add a say () block below the analyse image from () block.
- Inside the space of the say () block, drop a get expression of face () block. This block will figure out our expression and then the say block will make Tobi tell us the expression detected.
Click the green flag to run the script and have fun! If Tobi is in the center of the stage and your facial expressions are not detected properly, then move Tobi to the corner or from the analyse image from () block, select camera from the drop-down.
Save the file with the name Making an Expression Mimic Bot.
Quarky Mimics the Expression!
Now, let’s modify our script to make Quarky mimic our expression! Follow the simple step below:
- In the same script, add an if block below the say () block. Using this block we’re going to check which expression has been detected.Let us first check for the happy expression.
- Inside the white space of the if block, add an is expression of face () () block. happy is the default option so you don’t need to change anything.If the detected expression is happy, then Quarky must also be happy!
- Go to the Display palette and drop a display () expression block inside the if block. happy is the default option so you don’t need to change anything here as well.
- Repeat steps 2 and 3 for sad, surprised, and angry expressions.
Click the green flag to run the script and have fun!
Assignment
Before you move on to the next lesson, a small assignment awaits you!
You must upload the PictoBlox program you created in this activity to the website. Submitting the assignment is a must in order to receive the certificate after completing the course.
Follow the steps below to upload your assignment:
- Click on Browse.
- Search and Select your saved Project file(.sb3) and Click Open.
- Click on Upload to submit the assignment.
Good luck!