All Projects → dekuNukem → Facepunch

dekuNukem / Facepunch

Licence: mit
Raspberry Pi based facial recognition punch clock

Programming Languages

python
139335 projects - #7 most used programming language

facepunch: A facial recognition punch clock

facepunch tracks how many hours you spend sitting in front of your desk.

Alt text

The concept is rather simple: the picamera takes a photo every 15 seconds, if my face is found, current time is recorded.

The logged time is then added up to calculate my exact working hours every week. The result is displayed on an OLED screen.

What you need

OLED is optional, skip related steps if you're not using one.

Get it working

Set up Raspberry pi

Install the latest Raspbian here

Wire up OLED display and camera

OLED install guide

Camera install guide

I placed the camera and OLED together on a perf board that plug into the header, of course you can put them somewhere else or design your own PCB.

Alt text

Install required libraries

luma OLED library, install for python3.

face_recognition library

Provide your photo

The program needs a picture of your face in order to learn what you look like. Get a picture of your well-lit face with a clean background, name it me.jpg and place it in the software folder. The resolution should be around 400x400 otherwise the processing time is going to be long. An example is already provided so just replace it with your own.

Run the program

Run python3 detect.py to start face detection and logging.

Run python3 display_oled.py to display time statistics on the OLED.

Or if not using an OLED, run python3 display_text.py to print the statistics to the terminal.

You might have to play with camera.rotation and camera.brightness at the beginning of detect.py depending on how your camera is oriented and your lighting condition. You can open up image.jpg to see the latest photo taken.

Default OLED reset pin is 17, change it to what you use in display_oled.py.

Limitations

  • All timestamps are in UTC. I'm in UK so this isn't a issue, but you can play with python datetime timezones if it bothers you.

  • It only keeps track of a single face since I made it for myself. However it's trivially easy to change it to recognize multiple faces.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].