Things used in this project

Hardware components:
475267 240424 01 front zoom kankcmvqdh
Raspberry Pi Zero Wireless
11868 00a
Raspberry Pi Camera module
Nova icon lijwm6pmk7
Hologram Nova
Pi Zero USB shield
Not required, but makes developing for the board way easier since you can plug in a keyboard, mouse and the Hologram Nova all at once.
Software apps and online services:
Face Recognition Library
Hologram Python SDK


Demo codePython
sudo python
import face_recognition
import picamera
import numpy as np
from Hologram.HologramCloud import HologramCloud
import urllib

camera = picamera.PiCamera()
#For a non-demo, use a better camera with higher resolution
camera.resolution = (320, 240)
output = np.empty((240, 320, 3), dtype=np.uint8)
camera_name = "demo"

face_locations = []
face_encodings = []

credentials = {'devicekey': 'INSERT_KEY_HERE'}
cloud = HologramCloud(credentials, network='cellular', authentication_type='csrpsk')
phone_number = "+15551234567"

print cloud.version
print cloud.network_type

while True:
    sms_obj = cloud.popReceivedSMS()
    if sms_obj is not None:
        print sms_obj.message
        #replace urllib once hologram supports downloading non-string bytes
        urllib.urlretrieve(sms_obj.message, "lost_child.jpg")
        child_image = face_recognition.load_image_file("lost_child.jpg")
        child_encoding = face_recognition.face_encoding(child_image)[0]
        print "Lost child's face encoded"
        while True:
            camera.capture(output, format="rgb")
            face_locations = face_recognition.face_locations(output)
            if len(face_locations) > 0:
                print("Found {} faces in image.".format(len(face_locations)))
                for face_encoding in face_encodings:
                    match = face_recognition.compare_faces([child_encoding], face_encoding)
                    if match[0]:
                        recv = cloud.sendSMS(phone_number, 'Child found at camera: ' + camera_name)
                        print 'response message ' + cloud.getResultString(recv)


Paul Trebilcox-Ruiz
13 projects β€’ 19 followers
Android Developer and Google Developer Expert (GDE) for IoT. Former zookeeper, current 501st and Rebel Legion member, have built real robots


Add projectSign up / Login