Coder Social home page Coder Social logo

facepunch's Introduction

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.

facepunch's People

Contributors

dekunukem avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.