https://editor.p5js.org/hnc247/sketches/pEnrjusYC
For this week’s assignment, I tweaked the handpose example we built in class into a regression model. I was inspired by the color pose regression tutorial and trained the output as a background color regression. I added two more inputs (coordinates of the middle finger), so each of the three fingers can control the corresponding R, G, and B value of the background. The middle finger for Green, the index finger for Blue, and the thumb for Red.
I first trained the system moving three fingers simultaneously as well as the RGB values to see if the model works. The result seems pretty accurate, lighting up the background when fingers are apart and dimming when they are close.
Then I trained and saved the data of moving my fingers separately. The middle finger controls Green, the index finger controls Blue, and the thumb controls Red. In order to incorporate all colors, I trained all the scenarios, which took me quite a while.
I managed to make it work before saving the data and the model. After adding the load model function, the system seems to stop working entirely. I assume there’s something wrong with my “brainLoaded” function.