board_to_fen
v0.0.14
Python軟件包將數字棋盤圖像轉換為Forsyth-Edwards符號(FEN)符號
board_to_fen可在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 ))或者,如果願意,可以自己加載圖像對象:
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 ))注意:軟件包使用TensorFlow+Keras API。他們很重。
get_fen_from_image_path take有3個參數:
可在以下網址獲得:https://board2fen.bieda.it
對於培訓,您可能想通過克隆存儲庫來下載源代碼:
$ git clone https://github.com/mcdominik/board_to_fen.git
從:
將來我會為數據提供URL
在主要存儲庫中,運行
$ python3 ./board_to_fen/train_model.py
2023年1月
2023年2月版本0.1.0-0.1.1
https://www.kaggle.com/datasets/koryakinp/chess-positions