This program finds what pieces moved from an intial image of a chessboard and gives that move to Leela Chess Zero which is Open source neural network based chess engine (https://lczero.org/) with Maias Weights (https://github.com/CSSLab/maia-chess):
Please change your config in .Example env in Cpu to match your Auth0 api settings and Lc0 config and rename '.Example env' to '.env'.
- install docker on your system https://docs.docker.com/engine/install/
- follow the guide at https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html and install for your system.
- run
docker build -t chessai .
in directory Nvidia containing the Dockerfile - run
docker run -p 9081:9081 --gpus all chessai
- install docker on your system https://docs.docker.com/engine/install/
- run
docker build -t chessai .
in directory Cpu directory containing the Dockerfile - run
docker run -p 9081:9081 --gpus all chessai
Set the strenght to the depth you want in this case it is set to 1.
import requests
url = "http://localhost:9081/upload" #set your server address
payload = {}
files=[
('file',('test1.png',open('$PATHTOFILE','rb'),'image/png')) # replace $PATHTOFILE to the file path of the image
]
headers = {
'authorization': $YOUROAuth2ClientSecretGoesHere # replace this value with your auth0 key
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
This resets the entire board and starts a fresh game with option to let AI play as white
import requests
url = "http://localhost:9081/gamestat" #set your server address
payload = {'reset': 'true',
'iswhite': 'true'} # change value iswhite to false if you are playing as white
files=[
]
headers = {
'authorization': $YOURAuth0ClientSecretGoesHere # replace this value with your auth0 key
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
conda env export --from-history > linux_environment.yml