Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
VGSources
Artificial Intelligence

How to Build an AI Rock-Paper-Scissors Game with Hand-Gesture Recognition

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

An AI rock-paper-scissors game is a three-stage pipeline: a camera supplies frames, a hand-tracking system finds hand landmarks, and a gesture classifier predicts rock, paper, scissors or an unknown state. Separate game logic then compares the recognized move with the computer’s move and decides the result. MediaPipe’s Gesture Recognizer supports still images, decoded video and live video, so the same design can power a photo demo or an interactive webcam game.

How the recognition pipeline works

Recognition and game rules should remain separate. The vision model answers “What hand pose is visible?” The game answers “Who wins this round?” Keeping those responsibilities apart makes it easier to replace the model, add players or change the rules without rewriting the entire application.

  1. Capture: Read a still image, video frame or live camera frame.
  2. Detect and localize: The hand-landmark stage identifies the hand and estimates its geometry. MediaPipe reports 21 hand-knuckle coordinates, including image coordinates and world coordinates.
  3. Classify: A gesture model maps the hand geometry to a category and score. The documented task can also return handedness and results for multiple hands.
  4. Validate: Apply a confidence threshold and accept only a stable, supported move. Otherwise return none or wait for a clearer pose.
  5. Apply rules: Compare the accepted move with the opponent’s move and display the round result.

Google’s task documentation describes a model bundle containing hand-landmark and gesture-classification components. The landmark model was trained on approximately 30,000 real-world images plus rendered synthetic hand models across varied backgrounds. That figure describes landmark-model training, not rock-paper-scissors accuracy.

Choosing an input: image, video or webcam

Input Best use What you need
Still image Early experiments, debugging labels and demonstrations An image supplied to the recognizer
Decoded video Replay analysis or testing a recorded hand sequence A video decoder and frame-processing loop
Live video Interactive play against the computer A camera stream and a loop that processes incoming frames

A built-in camera is sufficient when it delivers usable frames. A separate USB webcam is optional, not a requirement; it is useful only when the computer lacks a suitable camera or its placement and image quality are inadequate.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Using MediaPipe’s recognizer

The documented Gesture Recognizer provides a pretrained starting point and exposes settings for score thresholds and hand-presence confidence. It accepts the three input modes above and returns gesture categories, landmarks and handedness. For a game, treat the category as a prediction rather than certainty: reject low-score results, and require the same move to persist across several frames before locking a round.

Handling the none category

Google’s customization example uses four labels: rock, paper, scissors and none. The none label represents poses outside the named game gestures. Keeping that outcome prevents a partially visible, badly framed or unrelated hand pose from becoming an accidental move.

Rank #2
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works

Typical frame-state logic

  1. Process each frame and collect the top gesture and score.
  2. Discard frames with no detected hand or a score below your chosen threshold.
  3. Track consecutive predictions; reset the counter when the label changes or becomes none.
  4. When a label remains stable for your chosen number of frames, lock the player’s move.
  5. Stop accepting new frames until the round is resolved and the player shows none or otherwise resets the hand state.

The exact threshold and stability window depend on the camera, lighting, distance and users. They should be tuned with the hardware on which the game will run rather than copied as universal values.

Writing the rock-paper-scissors game logic

Once a valid label is available, the game no longer needs computer vision. Generate or select the opponent’s move, then apply the ordinary cycle:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Xweiryn Webcam for PC, HD 1080P USB Plug-and-Play Computer Web Camera, High Definition Webcam for Desktop Laptop, Ideal for Online Class, Video Conference, Live Streaming & Gaming
  • 1080P HD Webcam: This HD webcam delivers crisp 1080p video quality, ideal for PCs, desktops, and laptops. Perfect for video calls, online classes, meetings, live streaming, gaming, and everyday recording. It provides clear, sharp images and smooth video at up to 30 frames per second. This live streaming webcam works with platforms such as Zoom, Teams, FaceTime, Google Meet, and YouTube.
  • USB Plug and Play Webcam: Designed for PCs, this webcam is easy to use. No drivers or software are required; simply connect the webcam to your computer and start using it immediately. Operation is smooth and convenient. XWEIRYN webcams are compatible with multiple operating systems, including Mac/Windows XP/7/8/10/11/PC/Laptops.
  • Widely Compatible Webcam: This versatile webcam is compatible with most operating systems and major video platforms. As a reliable computer webcam, it supports video conferencing, remote learning, live streaming, and gaming, meeting your various needs for daily work and entertainment.
  • Smooth and Stable Performance: This webcam uses a stable transmission chip to ensure smooth, lag-free video streaming, synchronized audio and video, and no dropped frames. Even after prolonged use, this durable webcam maintains stable performance. It performs excellently even in low-light environments. It automatically adjusts to adapt to low-light conditions, reducing noise and restoring vibrant colors, ensuring clear and sharp images even without additional studio lighting.
  • Compact and Adjustable Design: This lightweight and portable webcam saves space and comes with an adjustable clip. Our USB webcam uses a reliable USB 2.0/3.0 connection and comes with an upgraded 1.5-meter (5-foot) braided cable. It is compatible with Desktop most monitors and Laptop. Its portable design makes it easy to place and carry, ideal for home, office, or travel use.
  • Rock beats scissors.
  • Scissors beats paper.
  • Paper beats rock.
  • Identical moves are a draw.

A clean implementation represents each move as a value and uses a small rule table or mapping to determine the outcome. Keep camera processing, move validation, opponent selection, scoring and display as separate functions or modules. This makes a “best of five” mode, a two-player mode or a non-camera test harness straightforward to add.

Pretrained model or custom gesture model?

Approach Advantages Trade-offs
Pretrained Gesture Recognizer Documented task, ready-made inference and standard outputs Its built-in categories and behavior may not match your poses, camera angle or interaction design
Custom Model Maker recognizer Labels and examples can be tailored to your users, framing and gestures You must collect representative data, train, evaluate and export a model asset bundle
Landmark-plus-geometry rules Simple, transparent logic; a public RPS example demonstrates angle-based classification after MediaPipe hand tracking Rules can be brittle when viewpoint, occlusion or hand shape changes; no cited comparison establishes superior accuracy

Custom training workflow

Google’s customization guide organizes images in folders by label and requires a none folder. The documented workflow runs the hand detector to obtain landmarks, trains a gesture classifier with Model Maker, evaluates it on a test split and exports a model asset bundle. The Google Developers Blog presents the same load, split, train, evaluate and export sequence as an example; it is a workflow description, not a promise that a small dataset will be reliable.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)

Collect examples from the intended camera distance, backgrounds, lighting conditions, skin tones, hand orientations and users. Keep a held-out test set that is not used for training. Report the camera, lighting, number and identities of users, class balance and decision threshold whenever publishing a performance number.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Designing the webcam game loop

  1. Open the default camera or selected video device.
  2. Convert each captured frame into the format required by the recognizer.
  3. Run hand detection and gesture classification.
  4. Overlay the predicted label, score and optional landmarks for debugging.
  5. Pass only a validated, stable move to the game-state controller.
  6. Display the player’s move, the opponent’s move, the outcome and the running score.
  7. Release the camera and close the display window when the user exits.

A public NTU ARL example, 03_game_rps.py, illustrates this general arrangement with webcam capture, MediaPipe processing, an angle-based classifier and an OpenCV display loop. It demonstrates an implementation pattern, not a controlled benchmark or endorsement.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Common failure modes and fixes

  • No hand detected: Move the hand fully into frame, improve lighting and reduce distance from the camera.
  • Moves change every frame: Add a confidence cutoff and temporal stability requirement instead of using one frame as the decision.
  • Paper is confused with another pose: Add varied training examples or revise the geometry rules for the actual camera viewpoint.
  • Accidental rounds: Require a none reset between rounds and ignore low-confidence predictions.
  • Two hands appear: Define whether the game accepts one designated hand or needs a policy for multiple detections; the task can report results for multiple hands.
  • Performance varies by setup: Test the exact camera, lighting, framing and users planned for deployment. The cited sources establish no general accuracy percentage across those conditions.

What is and is not established about accuracy

Neither the cited task documentation nor the implementation examples establishes a general rock-paper-scissors accuracy, frame rate or latency figure across devices and environments. Repository claims such as “95% accuracy” should not be generalized without a named test set, hardware and evaluation method. A credible report should state those conditions and distinguish landmark-detection performance from the final game-label accuracy.

Source notes

The technical behavior described here follows Google AI Edge and Google for Developers documentation for the Gesture Recognizer and its hand-gesture customization guide, the Google Developers Blog’s Model Maker workflow example, and the NTU ARL 03_game_rps.py webcam implementation. IEEE Xplore’s 2025 “Gesture Showdown: Rock Paper Scissors with AI Vision” abstract describes a MediaPipe, OpenCV and camera-video approach, but it is evidence of a project method rather than independent performance validation.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.