{"id":28101307,"url":"https://github.com/imshymike/handgestures","last_synced_at":"2026-04-18T07:31:14.316Z","repository":{"id":287425145,"uuid":"964588533","full_name":"ImShyMike/HandGestures","owner":"ImShyMike","description":"Python library that makes it easy to create and detect custom gestures using mediapipe","archived":false,"fork":false,"pushed_at":"2025-05-08T15:28:01.000Z","size":31,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-13T19:13:39.820Z","etag":null,"topics":["hand-gesture-recognition","hand-tracking","mediapipe","mediapipe-hands","opencv"],"latest_commit_sha":null,"homepage":"","language":"Python","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/ImShyMike.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-11T13:05:02.000Z","updated_at":"2025-05-08T15:15:08.000Z","dependencies_parsed_at":"2025-04-11T17:32:48.135Z","dependency_job_id":null,"html_url":"https://github.com/ImShyMike/HandGestures","commit_stats":null,"previous_names":["imshymike/handgestures"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ImShyMike/HandGestures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImShyMike%2FHandGestures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImShyMike%2FHandGestures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImShyMike%2FHandGestures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImShyMike%2FHandGestures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImShyMike","download_url":"https://codeload.github.com/ImShyMike/HandGestures/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImShyMike%2FHandGestures/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961073,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["hand-gesture-recognition","hand-tracking","mediapipe","mediapipe-hands","opencv"],"created_at":"2025-05-13T18:54:48.411Z","updated_at":"2026-04-18T07:31:14.292Z","avatar_url":"https://github.com/ImShyMike.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HandGestures\n\nPython library that makes it easy to create and detect custom gestures using mediapipe.\n\n## Example Image\n\n![floating mouse demo](assets/floating_mouse.png)\n\n(the image is using the 'floating_mouse.py' example with the debug option '_blank_frame=True')\n\n## Example Code\n\n```python\n# Import the needed classes\nfrom hand_gestures import Condition, GestureBuilder, GestureHandler\n\n# First define a list of gestures\nclass Gestures:\n    NONE = \"none\"\n    FIST = \"fist\"\n    GRAB = \"grab\"\n    OK = \"ok\"\n    PINCH = \"pinch\"\n    TWO_UP = \"two up\"\n\n\n# Then create the gesture handler (this will use the camera)\nhandler = GestureHandler(0)\n\n\n# This function is an example for a callback\ndef callback_func(callback_dict):\n    print(\n        f\"1 - Hand: {callback_dict[0]['hand']}, Distance: {callback_dict[0]['distance']}, Condition Median Point: {callback_dict[0]['condition_median_point']}\"\n    )\n\n# This callback will be used as the main callback and it is called on every frame\ndef main_callback_func(hand, detected_gestures, hand_scale, hand_positions):\n    # Using 'detected_gestures' you can set which gesture is being detected\n    # (this may look redundant but it is needed as sometimes multiple gestures are detected at once)\n    if not detected_gestures:\n        handler.set_gesture(hand, Gestures.NONE)\n        return\n\n    if Gestures.OK in detected_gestures:\n        # Here, FIST takes priority over OK (if both are present)\n        if Gestures.FIST in detected_gestures:\n            handler.set_gesture(hand, Gestures.FIST)\n        else:\n            handler.set_gesture(hand, Gestures.OK)\n\n    elif Gestures.GRAB in detected_gestures:\n        handler.set_gesture(hand, Gestures.GRAB)\n\n    elif Gestures.PINCH in detected_gestures:\n        handler.set_gesture(hand, Gestures.PINCH)\n\n    elif Gestures.TWO_UP in detected_gestures:\n        handler.set_gesture(hand, Gestures.TWO_UP)\n\n# Then define all the gestures by using conditions\n# (coordinates are in screen distance and are normalized from 0.0 to 1.0)\nok = GestureBuilder(Gestures.OK, [Condition(0, [8, 12, 16, 20], 0.15)])\n# The structure is GestureBuilder(gesture name, [list of conditions])\n# Each condition can have many settings but the required ones are:\n# landmark1, landamark2, distance (landmark2 can be a list)\n\n# A visual landmark cheatsheet can be found here:\n# https://mediapipe.dev/images/mobile/hand_landmarks.png\n\nfist = GestureBuilder(Gestures.FIST, [Condition(4, 6, 0.05)])\n\ngrab = GestureBuilder(\n    Gestures.GRAB, [Condition(4, 8, 0.05, hand=\"Left\")], callback=callback_func\n)\n\npinch = GestureBuilder(Gestures.PINCH, [Condition(4, 12, 0.05, hand=\"Right\")])\n\ntwo_up = GestureBuilder(\n    Gestures.TWO_UP,\n    [Condition(4, [16, 20], 0.1), Condition(8, 12, 0.05, invert_check=True)],\n)\n\n# Finally, start the running loop with all of your gestures (blocking)\nhandler.init([fist, ok, grab, pinch, two_up], main_callback_func)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimshymike%2Fhandgestures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimshymike%2Fhandgestures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimshymike%2Fhandgestures/lists"}