Inspiration

This hack was inspired by a music hack we had build before. The idea was to use emotion analysis to play music appropriate to the mood. So we took the concept of emotions to re-invent the game of rock-paper-scissor.

What it does

Depending on the range of emotions, we consolidate your image to either "Anger", "Sadness", or "Happiness". Anger beats Happiness, Happiness beats Sadness, and Sadness beats Anger.

How I built it

This is built using the affectiva and pubnub apis. The affectiva api is used to fetch the emotions for an image and the pubnub apis are used to send challenge indications in real time, as well as capture the emotions on each player's screen and send it to the other player. The algorithm on the browser then evaluates the dominant emotion and decides the winner based on the rules stated above.

Challenges I ran into

We found out that one of the affectiva documentation pages had a problem. I also ran into a limitation with the pubnub api where it was informed to me that I couldn't send messages more than 32kb. This was a problem since I was attempting to send imageData over a pubnub message.

Accomplishments that I'm proud of

This was a fun hack and I was happy that we were able to use an old concept to build a neat little game.

What I learned

I learnt how to use the pub-sub mechanisms using pubnub and really liked using the affectiva apis as well. The documentation was very easy to work with.

What's next for Anger-Sad-Happy

I think we would probably need to host it and polish it a little nicely. Unfortunately, chrome seems to have blocked the app from being able to run the camera because of some new privacy policies that they introduced which has caused my app to not work today since 6am. But I believe I can show off the demo locally.

Built With

Share this project:

Updates