After my talk at Microsoft yesterday, I got introduced to Paul Foster who is running a makeshift 'hackspace' for TechDays 2015. He showed me around his collection of Raspbeery Pis, Arduinos, receivers, rockets and more. We talked a bit and as I had two days left at TechDays and not too much to do I asked him if I could join in. He gave me Raspberry Pi and a camera and told me to get it running with Project Oxford's algorithm for face recognition. It took me about 4 hours and here is how you can build it, too.
You need a Raspberry Pi and a camera for example from the Pi Foundation as well as an internet connection. I implemented this project with Python 3, because it was preinstalled on my Pi.
First, connect your camera to the camera-flex-port. Start your Pi, run 'sudo raspi-config' in your shell and enable the camera. Open a Python editor and paste my code. Insert your subscription key into the requests. Now, you can run different calls to the projext oxford site.
At the bottom of the code you find all the calls you need. You need to create a person group first with 'createPersonGroup'. Then, add a person to that person group with 'addPersonToGroup' which will take three pictures of you. Train the group with 'trainPersonGroup'. After the group has been trained successfuly with the pictures you took, you are ready to call 'identifyFace' and you should be greeted with 'WELCOME Jakob' after some API calls.
Obviously, my code is very static as the person name is fixed to 'Jakob' and the API calls are fixed to the Project Oxford site. Additionaly, it cannot handle multiple faces - but it works.
You need a Raspberry Pi and a camera for example from the Pi Foundation as well as an internet connection. I implemented this project with Python 3, because it was preinstalled on my Pi.
First, connect your camera to the camera-flex-port. Start your Pi, run 'sudo raspi-config' in your shell and enable the camera. Open a Python editor and paste my code. Insert your subscription key into the requests. Now, you can run different calls to the projext oxford site.
At the bottom of the code you find all the calls you need. You need to create a person group first with 'createPersonGroup'. Then, add a person to that person group with 'addPersonToGroup' which will take three pictures of you. Train the group with 'trainPersonGroup'. After the group has been trained successfuly with the pictures you took, you are ready to call 'identifyFace' and you should be greeted with 'WELCOME Jakob' after some API calls.
Obviously, my code is very static as the person name is fixed to 'Jakob' and the API calls are fixed to the Project Oxford site. Additionaly, it cannot handle multiple faces - but it works.