Advanced Mood Checker

Building on last week’s assignment, I decided to add more elements to my mood checker that uses poseNet. 

I created a new variable that increases or decreases in value depending on the pose classification. This variable will determine the position of the heart image to move left or right in order to fill in the heart. When the mood checker reads a positive emotion, it will control the heart to move continuously towards the pink heart, and if it reads negative emotions, it will move towards the grey heart. When it reaches either heart, it will stop moving and output a text. 

preloading imp
Preloading images

I began with preloading images and then drawing them in the function draw(). For the empty heart that is going to be in the middle, I put ‘a’ as its x coordinate which is defined to be 275 initially in the function setup(). The value of ‘a’ will constantly change. 

draw function
Drawing images with a variable ‘a’

Then, I made the value of ‘a’ to change according to the pose label. 

move the heart
Modifying the if statements

When the heart reaches a certain point, it outputs a message that can cheer up the user. It also makes the heart to stop moving by assigning an exact value. 

text output
Outputting text

Then, I tried out my program with my friends. Because only I knew the exact pose such as the angle of the arms, few had difficult times in getting the pose right. Therefore, I added console.log to see the confidence level and added another if statement to let the user know if the pose was accurate. 

def
Showing if the pose detection is accurate

Video: https://vimeo.com/manage/videos/635444366

p5.js code: https://editor.p5js.org/cs6240/sketches/wa97vZ-OJ

Leave a Reply

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