Built in a day and a night…

Having played with Project Oxford at Christmas and then seeing it launch just before Makerfaire at the Build conference, I was keen to include it as part of my stand as I felt it was fresh new and bleeding edge.

Microsoft Cognitive services is a cloud based API that allows you to send photos to it and get back a results showing how much of a pre-defined list of emotions, the faces in the photo are showing.

I could use this to put on a sticker to show everyone else how they are feeling…

I had got the main project finished on Thursday and had already arranged the Friday off work to setup and as contingency time. I set to work building the Cognitive mirror in a day and a night.

I took  some MDF, black spray painted the top that allowed me to conceal a camera, it turned out when people are concentrating on the mirror, jo public did not even notice the hole where the camera was, frankly I was amazed, and pleased.

I’d been planning to do this a few months back, so had bought the mirror and the discount shop. I repurposed the big switches I’d used last year for the animal scanning to use when people wanted to start the process. Finally I had purchased another thermal printer in anticipation.

I made an “A” frame behind the mirror back board to keep it up right, hot glued the mirror to the board to keep it there. Got another RPi, threw another Win IoT core image onto and SD and booted up.

I then sat down and coded the code. Luckily as I’d played with the API at Christmas and already had API keys etc I was able to quickly make it return the result from the webcam attached to the mirror.

The result contains face frames, so I used the face frames to cookie cut the faces out of the original image, I then married this with the stats returned from the API.

This then was dithered and printed onto a sticker, for the top three emotions.

It all came together quite quickly and worked well.

It was well worth doing as this became a good talking point to the more technical people visiting the stand, and everyone else just found it amazing magic how it worked out what they were showing on their faces.

On  the Sunday morning while having breakfast I chop sawed and drilled and hot glued in 10mins a new switch as the industrial switch had too strong a spring for some visitors to use. The connection to the PI was also flaky so I improved that at the same time. The new switch I was quite proud of considering how little time it took to make.

Here is a shot of the mirror in action from behind the stand.

It got some amazing reactions as people tried to portray the various emotions.