chesscog.data_synthesis package

Module containing scripts for creating and reproducing the dataset synthesised from a 3D model of a chess set.

Notice that the Blender script for actually creating the dataset is located in scripts/synthesize_data.py and not the chesscog package itself because it uses bpy and Blender’s bundled Python interpreter. Thus the dependencies are not in line with chesscog itself.

It is recommended to use the download_dataset script to download the rendered dataset and then to split it into train/val/test using the split_dataset script.

Submodules

chesscog.data_synthesis.create_fens module

Script to extract FEN positions from the data://games.pgn database of chess game.

$ python -m chesscog.data_synthesis.create_fens --help
usage: create_fens.py [-h]

Create the fens.txt file by selecting 2%% of the positions from
games.pgn.

optional arguments:
  -h, --help  show this help message and exit

chesscog.data_synthesis.download_dataset module

Script to download the rendered dataset.

$ python -m chesscog.data_synthesis.download_dataset --help
usage: download_dataset.py [-h]

Download the rendered dataset.

optional arguments:
  -h, --help  show this help message and exit

chesscog.data_synthesis.download_pgn module

Script to download Magnus Carlsen’s chess games to data://games.pgn.

$ python -m chesscog.data_synthesis.download_pgn --help
usage: download_pgn.py [-h]

Download Magnus Carlsen's chess games to data://games.pgn.

optional arguments:
  -h, --help  show this help message and exit

chesscog.data_synthesis.split_dataset module

Script to split the rendered dataset into train (90%), val (3%), and test (7%) sets.

$ python -m chesscog.data_synthesis.split_dataset --help
usage: split_dataset.py [-h]

Split the dataset into train/val/test.

optional arguments:
  -h, --help  show this help message and exit

chesscog.data_synthesis.visualize module

Script to visualize the image and labels for a sample from the dataset.

$ python -m chesscog.data_synthesis.visualize --help
usage: visualize.py [-h] [--file FILE]

Visualize a sample from the dataset.

optional arguments:
  -h, --help   show this help message and exit
  --file FILE  path to image file