board_to_fen
v0.0.14
Python package that converts digital chessboard image into Forsyth-Edwards notation (FEN) notation
board_to_fen is available on PyPI:
pip3 install board_to_fen
from board_to_fen.predict import get_fen_from_image_path
print(get_fen_from_image_path(PATH_TO_CHESSBOARD_IMAGE))or, if you want you can load image object by yourself:
from PIL import Image
from board_to_fen.predict import get_fen_from_image
img = Image.open(PATH_TO_CHESSBOARD_IMAGE)
print(get_fen_from_image(img))Note: The package uses tensorflow+keras API. They are pretty heavy.
get_fen_from_image_path takes has 3 arguments:
Available at: https://board2fen.bieda.it
For training You would probably want to download the source code by cloning the repository:
$ git clone https://github.com/mcdominik/board_to_fen.git
Download training data from:
I will supply url for data in the future
In the main repository dir, run
$ python3 ./board_to_fen/train_model.py
january 2023
february 2023 version 0.1.0-0.1.1
https://www.kaggle.com/datasets/koryakinp/chess-positions