Chess piece classification CNN built with TensorFlow.
The model has a 94% test accuracy for our chess piece classes. See model.png for architecture.
See requirements.txt or run pip install -r requirements.txt.
The plot_model Keras function requires GraphViz to be installed and in PATH.
The first step to training the model is running preprocessing.py to generate your custom dataset with preprocessing methods that are included in the script.
By default our model uses data that is preprocessed with canny.py, however adaptive_threshold.py can be applied on the data preprocessing functionality instead.
Once the required data is generated, run train_model.py to train the model. The resulting model weights will be saved to a file in the weights directory with a name that corresponds to the number of epochs which the model was run with.
To run the model, run test_model.py. The arguments for this script are as follows:
- Weights file to load model weights from
- List of paths to picture to use in prediction
Example: python test_model.py 720_epoch_model_weights.h5 <path_to_picture>
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.