An intelligent chess assistant that leverages Computer Vision and Deep Learning to synchronize physical or digital chess boards with the Stockfish engine. The application captures the board state through image processing and provides real-time move suggestions.
This project was developed for a college-level competition, focusing on the practical application of AI and CV in gaming.
- Automated Board Detection: Real-time extraction of chess board grids using optimized OpenCV pipelines.
- Deep Learning Piece Recognition: Custom CNN model trained to classify chess pieces with high precision.
- Engine-Driven Analysis: Integrated with the Stockfish engine for top-tier move recommendations.
- Interactive UI: A feature-rich PyQt5 dashboard for board configuration, move visualization, and settings management.
- Hybrid Support: Works with both physical board captures and screen-based digital chess.
- Core: Python 3.x
- Computer Vision: OpenCV, Scikit-image
- Artificial Intelligence: TensorFlow/Keras (CNN)
- GUI Framework: PyQt5
- Backend Logic:
python-chessfor game state and move validation - Automation:
PyAutoGUIfor seamless screen interaction
- Python 3.7 or higher
- Stockfish Engine (Binary required)
-
Clone the Repository:
git clone https://github.com/dyaa-adel/ChessPlayer.git cd ChessPlayer -
Initialize Virtual Environment:
python -m venv .venv # Activate on Windows: .venv\Scripts\activate # Activate on Linux/macOS: source .venv/bin/activate
-
Install Dependencies:
pip install . -
Configure Stockfish:
- Download the Stockfish binary.
- Upon launching ChessPlayer, navigate to settings and point the "Engine Path" to your Stockfish executable (e.g.,
stockfish_20011801_x64.exe).
Launch the application using the entry point:
chess-player| Piece | White | Black |
|---|---|---|
| Rook | r |
Shift + r |
| Knight | n |
Shift + n |
| Bishop | b |
Shift + b |
| Queen | q |
Shift + q |
| King | k |
Shift + k |
| Pawn | p |
Shift + p |
| Action | Key | |
| Remove Piece | Backspace |
Watch the application in action: YouTube Video Link
- Dyaa Adel (@dyaa-adel)
- Abdullah Emad
- Abdulrahman Mamdouh
This project is licensed under the MIT License - see the LICENSE file for details.
Icons provided by ultimatearm from Flaticon.