This is a part of implement of the smart office. Now, the smart reception is just an single sense which only support to unlock the door if known employees come.
- an IPC installed in front of the office entrance;
- a smart locker should be installed;
- both the IPC and the locker and the device which run this code should in the same network;
In this code, we simply finished the following sense:
- real time face detection: two ways are supported which are opencv and dlib;
- face recogtition: After detection, the face will be sent to a pre-trained VGG model to estimate who are they with the acceration by Movidius ncs, then, record the results to redis database;
- faceSensor: subscribe the recognition result, and envelop the result as a self-defined OCF face sensor. As soon as face recognized, it will notify all subscribers;
- faceApp: Observe the faceSensor resource and the smart locker resource as well, if the sensor report the known face, it will post a unlock message to the smart locker to unlock the door, and if not, nothing will be done.
Note: this sense has been performed on RaspberryPI + Intel Movidius ncs + Wulian smart home devices. The smart locker OCF device is not included in this code.
- install the dlib
- install opencv3, python-opencv and associated
- install dependency: like numpy, redis, redis-server
- install ncs sdk
- install for CoAP Server:
a. pip3 install LinkHeader
b. install aiocoap - install the iotivity sdk
- compile the faceApp and faceSensor
url: the rtsp stream url of the IPC
graph: the graph file loadable by Movidius ncs
mean: mean file of the all trained faces;
label: label file of the pre-trained model, here is the names of the faces;
fps: skip how many frames when processing;
resize: for acceration in some low performance platform like raspberry pi, zoom out the size of the frame to be processed;
debug: int value. set to none zero if you want to enable debug;
- python3 detect.py -c conf.json
- python3 server.py
- run the face app and face sensor
If you like this code or idea, please consider donating to the address below.
fengping [email protected]
1HDHUQGjU42ytfJDud1vGuJb4HksUcATjh
replace the detection and recognition with the face-comparation or realtime-face-recognition.
connect to the attendance system, which should also detect the off work;
support the legacy unlock device;