{"id":20188645,"url":"https://github.com/der3318/head-mapped-key","last_synced_at":"2025-06-15T00:34:04.253Z","repository":{"id":202863421,"uuid":"701679887","full_name":"der3318/head-mapped-key","owner":"der3318","description":"Java Console App - Control Keyboard Using Head With Webcam","archived":false,"fork":false,"pushed_at":"2023-10-22T06:32:16.000Z","size":22648,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T07:13:59.998Z","etag":null,"topics":["automation","keyboard","onnxruntime","pose","webcam"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/der3318.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-07T08:49:04.000Z","updated_at":"2023-10-16T15:45:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"39857123-a34a-4aff-a76a-936177a5666b","html_url":"https://github.com/der3318/head-mapped-key","commit_stats":null,"previous_names":["der3318/head-mapped-key"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/der3318/head-mapped-key","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fhead-mapped-key","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fhead-mapped-key/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fhead-mapped-key/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fhead-mapped-key/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/der3318","download_url":"https://codeload.github.com/der3318/head-mapped-key/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/der3318%2Fhead-mapped-key/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259905407,"owners_count":22929916,"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":["automation","keyboard","onnxruntime","pose","webcam"],"created_at":"2024-11-14T03:30:02.638Z","updated_at":"2025-06-15T00:34:04.219Z","avatar_url":"https://github.com/der3318.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n## ⌨️ Head Pose Keyboard Mapping\n\n![java](https://img.shields.io/badge/java-17+-blue.svg)\n[![webcam](https://img.shields.io/badge/com.github.sarxos:webcam--capture-0.3.12-yellow.svg)](https://github.com/sarxos/webcam-capture)\n[![ort](https://img.shields.io/badge/onnxruntime-1.16.0-pink.svg)](https://github.com/microsoft/onnxruntime)\n![portable](https://img.shields.io/badge/portable-win%20x64-green.svg)\n![license](https://img.shields.io/badge/license-MIT%20%28inherited%29-blueviolet.svg)\n\nA Java program that can trigger keyboard actions using head poses streamed from PC camera, leveraging the end-to-end landmark detection ONNX model (ref: [atksh/onnx-facial-lmk-detector](https://github.com/atksh/onnx-facial-lmk-detector)): \n\n![DemoUsage.gif](https://github.com/der3318/head-mapped-key/blob/main/imgs/DemoUsage.gif)\n\n\n### How to Run\n\n| Using Portable Version |\n| :- |\n| For Windows AMD64 devices, an all-in-one app package [head-mapped-key-portable-x64.zip](https://github.com/der3318/head-mapped-key/releases/download/2023.10.16/head-mapped-key-portable-x64.zip) is available. Unzip and double-click `launch.bat` to turn camera on and start the tool. |\n\n\n| Using JRE 17+ |\n| :- |\n| Download fat JAR [head-mapped-key-all.jar](https://github.com/der3318/head-mapped-key/releases/download/2023.10.16/head-mapped-key-all.jar), [model.onnx](https://github.com/der3318/head-mapped-key/blob/main/model.onnx) and [app.properties](https://github.com/der3318/head-mapped-key/blob/main/app.properties) from repo. Put them together and run `java -Duser.language=en -Dfile.encoding=UTF8 -jar head-mapped-key-all.jar` in CLI. |\n\n\n| Using Gradle Wrapper |\n| :- |\n| Clone the repository and use `gradlew run` command. |\n\n\nDebug messages will be dumpped directly to the console. Press CTRL+C to stop listening. A JVM shutdown hook will help release resouces gracefully, including camera handle.\n\nAlso noted that the responsiveness of the tracking mechanism highly depends on the actual CPU speed. For example, on a 4-Core 1.90GHz Intel laptop, each frame takes about 900ms to process, which makes the overall experience a bit lagging.\n\n\n### Customizing Settings\n\nThe editable `app.properties` (plain text file) provides basic values that can be consumed during runtime:\n\n```txt\n# preferred camera (will be prioritized if any)\ncamera.keyword=Camera Front\n\n# how many ms should the worker wait to take next webcam capture\nworker.delay=100\n\n# https://docs.oracle.com/en/java/javase/17/docs/api/java.desktop/java/awt/event/KeyEvent.html\nkeyname.head.left=VK_LEFT\nkeyname.head.right=VK_RIGHT\n```\n\nKey mappings based on personal need would be the most useful one.\n\n\n### How to Build \u0026 Redistribute\n\nTo compile the sources, JDK 17+ should be either accessible via environment variable `JAVA_HOME`, or the Java excutables are avaiable under `PATH`. This is the only prerequisite.\n\nCommand `gradlew shadowJar` will download Gradle v8.3 and use it to build the redistributable JAR: `build/libs/head-mapped-key-all.jar`, including all the dependencies.\n\n\n### Inference Logic Behind the Scene\n\nNothing fancy. Given the horizontal locations of eyes and nose, the head turn can be roughly inferred.\n\n![SampleFace.gif](https://github.com/der3318/head-mapped-key/blob/main/imgs/SampleFace.jpg)\n\nFor instance, `(Nose.X - LeftEye.X) : (RightEye.X - Nose.X) = (3 or higher) : 1` implies the head is facing relatively left (mirrored) to the sensor, and vice versa. Otherwise, the pose is considered centered.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fder3318%2Fhead-mapped-key","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fder3318%2Fhead-mapped-key","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fder3318%2Fhead-mapped-key/lists"}