Keep Hope Alive
This is Day 5 (for me) of the DeepLens Challenge, which I talked about starting in my post here. I have to submit my project by February 12th or 13th. I’m making progress toward my project goal, which right now is simply to recognize a face in an image cache from a live video feed using the stock face detection model on the DeepLens device. Face and image recognition is pretty common place today, I guess, but I’m stoked to get something similar working myself. I’d also love to integrate Alexa into the mix somehow as well, but I need to start making bigger strides with less messing about with the fiddly things!
Coding Challenges And Solutions
Some of the challenges I’ve faced, and (mostly) overcome, so far include:
- Cropping a detected face out of the DeepLens video feed in the Lambda Python script. Turns out this is very simple, but it took me a while to figure out.
- How to convert the cropped face image to a jpg and write it to disk. Also very simple in retrospect, but I’m a moron.
- I thought it would be easy to write the resulting face jpg to AWS S3 from the DeepLens edge device, but this one I just could not figure out due to permission issues. I can write to S3 using the aws cli as the aws_cam user, but so far I’ve not been able to extend those same permissions to the ggc_user account, which seems is what runs the awscam software. I even hard-coded credentials in the creation of my S3 client in the lambda code, but still had permission problems. I had to back-off from hacking on the device out of fear of really screwing something up, however. Best to stay off the DeepLens as much as possible in retrospect.
- The only way I was able to get a face image off the DeepLens and into the cloud so far is by converting it to a base64 String, putting into a JSON object, and putting it on the IoT Topic. I worry that all this data transfer is going to cost me an arm-and-a-leg by the end of this thing…
- When creating a lambda function to read from the IoT Topic, I kept getting a random error when trying to save it, which made no sense as I was following an AWS Blog Post for how to do the same. Then I found this: https://forums.aws.amazon.com/thread.jspa?messageID=825417&tstart=0. And this is what makes hackathons using new technology so fun! Writing software is really just lots of Google Searches.
And speaking of the Internet of Things (IoT), to-date I’ve thought this was just another marketing buzz word that wasn’t going to pan-out, so to speak. I used to think the same about ‘cloud’ (and still think this about Bitcoin and its ilk). But this DeepLens development challenge is giving me a greater appreciation for IoT and edge computing. In fact, we’ve been talking about the proliferation of internet connected things and the resulting possibilities since Java Jini, and probably before that, but I suspect Python will be its great enabler instead of Java at this point. But I digress…
Baby Steps, But Machine Learning Learning No Where In Sight
So as of today, I am able to leverage the stock face detection model to detect and crop a face out of a live video feed from DeepLens, send it up to the AWS Cloud Lambda IOT Topic Listener, and put it into an S3 Bucket. Next step is to try to figure out how to use the AWS Rekognition service to recognize face images in an image cache.
The Flow Zone
I’ve found listening to music particularly distracting these last few days. However, I find this Horn Solo in Tchaikovsky’s 5th Symphony really soothing and not distracting (but too short). I played this solo in Solo and Ensemble in High School. I’ve been told that french horn players are better kissers…