kochsebastian / ChessVisionBot

Chessbot using computer vision to play on any chess website
GNU General Public License v3.0
43 stars 22 forks source link
chess chess-ai computer-vision keras machine-learning neural-networks opencv python tensorflow

ChessVisionBot

The ChessVisionBot uses computer vision to detect a 2D chessboard on the screen. It detects played moves by the opponent and calculates the best response given a certain time to calculate. The ChessVisionBot is then able to move the mouse and execute the calculated move.
Thanks to the Stockfish-Engine it is able to play at a very high rating with quick movetimes.
Do not use this chessbot to play against a real human!

Playing Chess

ChessVisionBot vs Victoria on Chess24
(3 minute time control, ~1700 rating)
ChessVisionBot vs. Chess.com Computer Level 10
(unlimited time, ~2600 rating)
Computer Vision based Chess-Bot wins against Victoria on Chess24 Computer Vision based Chess-Bot wins against Chess.com Computer Level 10 (~2600 rating)
https://www.youtube.com/watch?v=z9LSJM55Tng https://www.youtube.com/watch?v=1aTEesXdODc

Solving Tactics

ChessVisionBot solves unknown Tactics on Chess.com
Computer Vision based Chess-Bot solves 25 random Chess-Tactics in a row
https://youtu.be/L6hSxr5kzo4

How to set-up and use

I won't publish a how to install instructions because I want to prevent non programmers to just use this project to cheat on chess websites. My intend with that project is combine computer vision and machine learning with chess and to learn something about every of these aspects.
For a programmer who has the same intentions installation and setting up the environment isn't that hard even though I provide no instructions. The project is only tested on a Mac environment so there may be some compablility problems but I guess nothing impossible to fix.
Feel free to edit the code as you like. If you want to contribute your changes I happily await your Pull Request.

Notice

Tensorflow has moved on from Tensorflow 1.0 and has exciting new functionalities with Tensorflow 2.0. Unfortunately, the current Tensorflow code is not compatible with Tensorflow 2.0 and unfortunately I lack the time to convert the code to the current Tensorflow syntax. I'm looking forward to a Pull Request from the community to update the old Tensorflow code, maybe even migrate the code to PyTorch.