Gesture Controlled Maze Game

Manea

About The Project:

This is a fun game where we control a Beetle through a maze using hand gestures! Using Scratch Machine Learning tools, we’ll train a Hand Gesture Classifier to recognize five gestures: Forward, Backward, Left, Right, and Stop. These gestures will control the Beetle, helping it avoid obstacles in the maze. Let’s get started and make the game interactive with our own hands!

Steps:

  1. Set up the ML environment in the Scratch AI platform.
  2. Collect hand gestures (e.g., palm facing forward for Forward, back of the palm for Backward, etc.).
  3. Train the model using data captured from the webcam.
  4. Test the model with real-time hand gestures.
  5. Export the trained model for use in the game.
  6. Create Scratch AI scripts to map the gestures to the Beetle’s movement.
Bash
1. Open Scratch AI Platform and load the "Beetle in the Maze" project.

   > Project loaded successfully.

2. Create a new project and select the "Hand Gesture Classifier" extension.

   > New project created and Hand Gesture Classifier extension added.

3. Upload hand gesture data (Forward, Backward, Left, Right, Stop).

   > Data uploaded: Forward, Backward, Left, Right, Stop.

4. Train the model with 20+ samples for each gesture.

   > Training in progress... 20+ samples for each gesture added.

5. Test the model with the webcam for real-time recognition.

   > Model testing... Real-time gesture recognition is successful.

6. Export the trained model to Scratch AI Platform.

   > Model exported successfully.

7. In the Block Coding environment:

   - Use blocks to open the recognition window.

   - Use blocks to analyze gestures from the webcam.

   - Assign corresponding Beetle actions (e.g., move forward on "Forward").

   > Blocks created and configured.

8. Run the game with hand gestures controlling the Beetle.

   > Game running... Beetle controlled via hand gestures.

Pseudo Code:

1. Open Scratch AI Platform and load the “Beetle in the Maze” project.

   > Project loaded successfully.

2. Create a new project and select the “Hand Gesture Classifier” extension.

   > New project created and Hand Gesture Classifier extension added.

3. Upload hand gesture data (Forward, Backward, Left, Right, Stop).

   > Data uploaded: Forward, Backward, Left, Right, Stop.

4. Train the model with 20+ samples for each gesture.

   > Training in progress… 20+ samples for each gesture added.

5. Test the model with the webcam for real-time recognition.

   > Model testing… Real-time gesture recognition is successful.

6. Export the trained model to Scratch AI Platform.

   > Model exported successfully.

7. In the Block Coding environment:

   – Use blocks to open the recognition window.

   – Use blocks to analyze gestures from the webcam.

   – Assign corresponding Beetle actions (e.g., move forward on “Forward”).

   > Blocks created and configured.

8. Run the game with hand gestures controlling the Beetle.

   > Game running… Beetle controlled via hand gestures.