Follow the Getting started to get set up. Create a new file with the code below or use https://bitbucket.org/socialroboticshub/framework/src/master/sic_framework/tests/demo_desktop_camera_facerecognition.py.
# Connect to the services camera = DesktopCamera() face_rec = DNNFaceRecognition() # Feed the camera images into the face recognition component face_rec.connect(camera) # Send back the outputs to this program camera.register_callback(on_image) face_rec.register_callback(on_faces) while True: img = imgs_buffer.get() faces = faces_buffer.get() for face in faces: draw_on_image(face, img) cv2.imshow('', img) cv2.waitKey(1)
Here is the schematic overview of how this program works. The camera streams its output to the face recognition service, and both stream the output to the program on your laptop.