Gesture Controlled Chess AI is an interactive chess system that allows players to play chess using hand gestures detected through a webcam.
The project combines Computer Vision ๐๏ธ, Artificial Intelligence ๐ง , and Game Logic โ๏ธ to create a unique chess experience. Hand gestures are detected using MediaPipe, processed with OpenCV, and the chess game is handled using python-chess and Pygame.
The project also integrates the Groq API โก to provide AI-powered chess insights and move analysis.
โ๏ธ Play chess against an AI opponent ๐๏ธ Control chess pieces using hand gestures ๐ท Real-time webcam gesture detection ๐ง AI-powered chess move analysis using Groq API ๐ฎ Interactive chess board interface using Pygame โก Fast and responsive gameplay
- Python ๐
- OpenCV โ Computer vision processing
- MediaPipe โ Hand tracking and gesture detection
- Pygame โ Chess board interface
- python-chess โ Chess game logic
- Groq API โ AI-powered move analysis
Chess-AI
โ
โโโ chess AI.py
โโโ requirements.txt
โโโ README.md
โโโ LICENSE
git clone https://github.com/rsamwilson2323-cloud/Chess-AI.git
cd Chess-AI
pip install -r requirements.txt
This project uses the Groq API for AI-powered chess insights.
Go to the Groq Console:
Sign up or log in.
- Open API Keys
- Click Create API Key
- Copy the generated key
Example:
gsk_xxxxxxxxxxxxxxxxxxxxxxxxx
Open the file:
chess AI.py
Find this section:
from groq import Groq
client = Groq(api_key="YOUR_API_KEY_HERE")
Replace it with your actual API key:
from groq import Groq
client = Groq(api_key="gsk_your_actual_api_key_here")
Run the program:
python "chess AI.py"
๐ท The webcam will start automatically and begin detecting hand gestures.
To exit the program:
Press ENTER โ
| Gesture | Action |
|---|---|
| Hand detection | Activates gesture tracking |
| Finger movement | Select chess pieces |
| Gesture confirmation | Perform the move |
1๏ธโฃ The webcam captures hand movements 2๏ธโฃ MediaPipe detects and tracks hand landmarks 3๏ธโฃ Gesture movements are converted into chess commands 4๏ธโฃ The python-chess engine validates moves 5๏ธโฃ The Groq AI assistant provides move analysis 6๏ธโฃ Pygame displays the chess board and updates moves
โ๏ธ Stronger chess AI engine integration ๐๏ธ Voice control support ๐ Online multiplayer mode ๐ค Improved gesture recognition accuracy ๐ AI-based move explanations
Sam Wilson
๐ GitHub https://github.com/rsamwilson2323-cloud
๐ผ LinkedIn https://www.linkedin.com/in/sam-wilson-14b554385
This project is licensed under the MIT License.