https://github.com/everythingishacked/Gamebody Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. {{ message }} everythingishacked / Gamebody Public * Notifications * Fork 1 * Star 70 Full-body game controller built with Python, OpenCV, Mediapipe License GPL-3.0 license 70 stars 1 fork Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights everythingishacked/Gamebody This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/e] Use Git or checkout with SVN using the web URL. [gh repo clone everyt] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @everythingishacked everythingishacked Add LICENSE ... 34ba2d2 Jun 30, 2023 Add LICENSE 34ba2d2 Git stats * 2 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time maps first June 28, 2023 15:50 LICENSE Add LICENSE June 30, 2023 08:13 README.md first June 28, 2023 15:50 body_landmarks.png first June 28, 2023 15:50 demo.gif first June 28, 2023 15:50 play.py first June 28, 2023 15:50 View code Semaphore Games A full-body game controller README.md Semaphore Games A full-body game controller demo View a fuller demo and more background on the project at https:// youtu.be/Vi3Li3TkUVY Semaphore Games uses OpenCV and MediaPipe's Pose detection to perform real-time detection of body landmarks from video input. From there, relative differences are calculated to determine specific positions and translate those into keys and commands sent via keyboard. For the best experience, you will need a big, well-lit space with a plain background and some combination of an external monitor, external webcam, or extremely good eyesight; standing far enough away from a built-in camera to fit multiple bodies with extended limbs takes significant distance. The primary way to "type" custom defined keys or key combinations is by extending arms and raising legs at various angles, with some additional recognized motions such as covering the mouth, crossing the arms, jumping, and squatting. Movements are mapped to keys based on a customizable CSV input file. See data/default.csv for the default example file. Using the --map option you can create and load in your own key mappings for different games. Example common usage: python play.py -f 1 -l 1 -s 2 -r 1 -m pong.csv - Flip the camera, draw body landmarks, split the screen for two players, record the results to a timestamped AVI, and use the pong.csv map for input controls. By default, extended arm angles snap to the closest 45 degrees, and leg angles are set to 18 degrees off of vertical (i.e. 18 for 'low kick' and 36 for 'high kick'). Modify LEG_EXTEND_ANGLE and the resulting angles in mapped leg extensions to update this sensitivity. An input file for key mapping should follow the format in default.csv, with the following columns: * 0: player number, starting at 1 * 1: body part or action, such as left arm or jump; full list below * 2: value for part or action: degrees such as 45 for arms, or 0/1/ 2 for legs * 3: key or keys to press, separated by spaces * 4: user-defined action description, such as accelerate or low punch The first row of each mapping file is skipped; it can be used for notes such as identifying or linking to the relevant game. The full set of parts/actions available are as follows: * left arm: takes values rounded to 45 degrees for fully extended arm; see below for degrees * right arm: same as above * left leg: takes values of 0 (low straight leg lift), 1 (high leg lift), or 2 (leg lift, bent at knee) * right leg: same as above * crossed arms: only takes the value 1; both palms touching opposite elbows * jump: only takes the value 1; hips quickly rising then falling * squat: only takes the value 1; both thighs parallel to ground, overrides leg lifts * mouth: only takes the value 1; cover mouth with both palms Right arm degrees: 90 straight up to 0 right to -90 down by side Left arm degrees: 90 straight up to 180 left to 269... -> -90 down by side Running on latest MacOS from Terminal, toggle the following for keyboard access: System Settings -> Privacy & Security -> Accessibility -> Terminal -> slide to allow For Mac, this uses a custom keyboard library imported locally to correct key mappings. About Full-body game controller built with Python, OpenCV, Mediapipe Resources Readme License GPL-3.0 license Stars 70 stars Watchers 4 watching Forks 1 fork Report repository Releases No releases published Packages 0 No packages published Languages * Python 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.