While I was away on holiday, Scott Sheppard announced an Autodesk-internal competition of which the eight lucky winners would receive a currently-still-hard-to-come-by Raspberry Pi Model B (so named in homage to the computer that helped inspire a generation of British programmers, the BBC Micro).
All that contestants had to do was submit an idea for a compelling use of the device (and then submit a video of the completed project, along with instructions to replicate it on Instructables.com). I’d been interested for some time in getting my hands on one of these cool little systems, and had a few ideas gestating for potential projects.
This competition helped crystalise one of these, in particular. Here’s the idea, which I’m happy to say resulted in me being one of the lucky eight:
I want to create a social media-enabled, friend-recognising, security webcam. This webcam would be located at a property’s front door, checking visitors against the owner’s Facebook friends, with a screen providing customised information on the owner’s status/location to people recognised as friends. It would also potentially post a message to the friend’s wall, thanking them for their visit.
Oh, and it might end up using a Kinect for data input – rather than a traditional webcam – as this could provide additional data about people actually approaching the house, rather than relying on motion detection that would be set off by people and cars passing by. (It was this final piece that got listed in Scott’s blog post – it remains to be seen whether this is feasible, given the relatively limited horsepower these devices have.)
I had some initial thoughts about how this might be work – and be implemented – but I’ve started to research more seriously now that I know it’s definitely happening. My original thoughts were along these lines:
- The Raspberry Pi – with USB-connected webcam – would sit there, waiting for someone to come along
- When a person’s face gets detected in the webcam’s video stream, it would be submitted to Face.com – a Facebook-enabled facial recognition web service – to find out whether this person was known to the owner(s)
- Depending on the friendship status of the visitor, it would be possible to provide a customised greeting and perhaps more accurate information on our physical location (although we’re not users of Foursquare in my family)
On the motion detection side of things, it seems there’s a pretty good component available for this.
For facial recognition, I was all set to use Face.com. Fellow Raspberry Pi enthusiast, AlexFielder, pointed out that Face.com had been acquired by Facebook – which didn’t necessarily get me worried until I found out this meant they were basically shutting down their web-service.
This came as a bit of a shock, to say the least, and certainly gives you pause for thought when considering adopting a web-based API in your product: you really need to trust that the service provider is not only going to stay in business, but is likely to respect their commitment to providing said service should they get acquired. Which is admittedly true of desktop software, even if – by the way it’s deployed – it’s less brittle on a day-to-day basis.
Every cloud has a silver lining: I expect Facebook’s automatic photo tagging capabilities to get a lot better over the next year or so. ;-)
I decided to send Face.com an email, asking what they recommend for people considering projects such as mine. They responded very promptly, echoing advice I’d already seen on their forum:
Following the Facebook acquisition the API is winding down and it's no longer possible to sign up and use it.
Re alternatives - OpenCV offers decent opensource face detection and face recognition, and there are commercial face recognition SDK options available for integration. If you're developing a mobile app, check out iOS' and Android's built in face detection functionality.
This was actually pretty interesting, in the sense having local recognition would hopefully make the system more robust and (possibly) responsive.
It also seems OpenCV can be made to work on the Pi, which gives me hope that I’ll be able to get this sample working there, too.
The sample detected me very promptly, although as I was the only person I’d trained it with, when my wife walked in the room she was detected as being me, also :-( :-). Hopefully it’ll give less false positives once I’ve worked out how to train it appropriately with a larger set of images.
I also haven’t given up on the Facebook integration side of things: right now I’m fooling around with the Facebook’s Graph API, using it to extract information on friends, as well as all the photos they’ve been tagged in. I haven’t yet found an effective way to use these photos to train the face database, but then it’s early days.
And the Pi is in the post, so I’ll soon be able to work with the actual device. Should be fun. :-)