{"id":13824782,"url":"https://github.com/cleder/login-picture","last_synced_at":"2025-04-28T02:32:14.441Z","repository":{"id":37931677,"uuid":"310885410","full_name":"cleder/login-picture","owner":"cleder","description":"📸️ Take a picture when you login 🥳️","archived":false,"fork":false,"pushed_at":"2025-04-01T08:10:34.000Z","size":17825,"stargazers_count":5,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-01T09:24:36.636Z","etag":null,"topics":["face-detection","face-recognition","hacktoberfest","opencv","opencv-python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cleder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-07T16:26:09.000Z","updated_at":"2025-04-01T08:10:37.000Z","dependencies_parsed_at":"2023-11-13T19:29:58.152Z","dependency_job_id":"4e3065ed-6f93-4299-b22e-107ac548d208","html_url":"https://github.com/cleder/login-picture","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Flogin-picture","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Flogin-picture/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Flogin-picture/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cleder%2Flogin-picture/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cleder","download_url":"https://codeload.github.com/cleder/login-picture/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251238225,"owners_count":21557421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["face-detection","face-recognition","hacktoberfest","opencv","opencv-python"],"created_at":"2024-08-04T09:01:09.253Z","updated_at":"2025-04-28T02:32:11.586Z","avatar_url":"https://github.com/cleder.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":" python script that takes a picture from you webcam when it detects or recognizes a face.\n![Timelapse](https://raw.githubusercontent.com/cleder/login-picture/main/timelapse.gif)\n\n# Installation\n\n## Linux\n\nExecute the installation script with `./install.sh`.\nThis will create a virtual environment and install the requirements.\nIt will also create an executable bash script `capture-login.sh` in your home directory.\nYou can run this as a [startup script](https://www.howtogeek.com/686952/how-to-manage-startup-programs-on-ubuntu-linux/) to take your photo whenever you login.\n\n## Windows\n\nInstall Python (3.10) from the Windows store.\nOpen Power Shell and run `pip install opencv-python`\nCreate a shortcut on your Desktop, enter `python.exe C:\\path\\to\\directory\\detcap.py` as the command to run.\nYou can run this shortcut [on startup](https://superuser.com/questions/954950/run-a-script-on-start-up-on-windows-10) to take a photo when you login.\n\n\n# Face detection\n\nThe script `capture-login.sh` will terminate and write a picture of you into the directory `~/Pictures/login-capture` once it detected\na face looking into the webcam.\n\n# Run from commandline\nActivate the virtualenv with `source venv/bin/activate`.\nRun the script with `python detcap.py`.\nThis will open a fullscreen window and take a picture when a face is detected. The picture will be stored in `~/Pictures/login-capture/` with the username and current date and time as the name.\n\n# Face recognition\n\n## Required libraries for ubuntu\n\n`sudo apt-get install build-essential cmake libopenblas-dev liblapack-dev libx11-dev libgtk-3-dev`\n\n## Training\n\nOnce you have captured a decent amount of pictures you can compute face embedding vectors for your images with `python encode_images.py`.\nThis will write an encoding file next to the original captured image of yor face with the extension `.cnn-encoded.pickle`.\nNo embeddings will be written for pictures where more than one face was detected.\n\n## Recognize your face on login\n\nTest the recognizer with `python recognize_me.py` and see how it performs.\nIt will save the recognized image along with the embedding once your face was recognized.\nYou may want to fine tune the `tolerance` parameter in `recognize_me.py`.\n\nRun `recognize-login.sh` on startup, the window will close once your face has been recognized.\nThe picture will be stored with its encoding in `~/Pictures/login-capture/` and will be used for future recognitions.\n\n\n# Background\n\nI used [howdy](https://github.com/boltgolt/howdy) to have a facial recognition login.\nWith this tool you can capture a picture on every login which can be used to train the howdy models.\nIt may also be fun to [create a video how you look over time](https://www.youtube.com/watch?v=wAIZ36GI4p8)\n\n## Create time lapse of your pictures\n\nI used [Face-Alignment](https://github.com/SajjadAemmi/Face-Alignment) as a preprocessor.\n\n###  Animated GIF with imagemagic\nThe images were resized and converted to gray-scale with the `convert` command of imagemagick:\n```\nfind /path/to/input/ -iname '*.jpg' -exec convert \\{} -verbose -colorspace Gray -set filename:base \"%[basename]\" -resize 256\\\u003e \"/path/to/output/%[filename:base].jpg\" \\;\n```\n\nAfterwards you can create an animated GIF in the `/path/to/output/` directory with:\n```\n convert -delay 15 -loop 0 *.jpg timelapse.gif\n```\n\n### Video with ffmpeg\nAlternatively you can create a video with ffmpeg:\n\n```\nffmpeg -framerate 5 -pattern_type glob -i '*.jpg' -c:v libx264 -r 30 -vf format=gray,scale=256:256 output.mp4\n```\n\nffmpeg -framerate 5 -pattern_type glob -i 'me/*.jpg' -c:v libx264 -r 30 -vf format=gray,scale=256:256,normalize=blackpt=black:whitept=white:smoothing=20:independence=0.5 output.mp4\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleder%2Flogin-picture","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcleder%2Flogin-picture","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcleder%2Flogin-picture/lists"}