Week 3: February 15th, 2023
Live Code Session :
BodyPix
Working with: poseNet, bodyPix
Idea: Wallflower game. As the foreground, try to blend into background!
- Set background random color and then do certain gestures or actions to change your color to match background.
- Have to “touch” circle or rect on screen to change respective body part’s color. each circle/rect will be a different color red, green, or blue and if you tap it, your body part will increase in R/G/B value. Goal is to reach white to blend in with background.
I started by taking a look at the code for bodypix-parts-custom.
Originally, the code for coloring the body parts was part of a global variable declaration.
However, since I wanted the colors to change in response to conditions, instead of remaining as a preset color, I moved the code to the gotResults function. Then, I could replace the hard coded numbers to variables.

I ran into a few issues. After setting the variables to equal 0, the color didn’t change. I even tried scrapping the variables and hard setting the color to [0, 0, 0] manually. I tried moving the code into setUp, but still no luck.
I realized I was only able to a visual change to the body part’s color after changing the numbers when it was defined next to the global variable.
Since I would have to set the color first before being able to draw it in the color I want, it would mean that my wallflower game wouldn’t be able to work.
New Idea:
- If I can’t change the color based on action (do action > results in color change), I can try the inverse (color set > do action). Similar to charades, I could have the user make hand gestures or body poses to resemble something with set colors. For example, their hands could be set to red, in which they’ll be tasked to make a heart shape with their hands.
- Alternatively, to create a bigger challenge, I could give the user colors and they would have to guess what they’re supposed to make and make it. However, it would be rather ambiguous and hard to guess.
- Regardless, in either case, I found that the boundaries of each body part, as well as the distinction between foreground and background were not well defined.
Another Idea: