Skip to content

etarthur/chess-piece-classification

Repository files navigation

Chess Piece Classification

Chess piece classification CNN built with TensorFlow.

Introduction

The model has a 94% test accuracy for our chess piece classes. See model.png for architecture.

Prerequisites

See requirements.txt or run pip install -r requirements.txt.

The plot_model Keras function requires GraphViz to be installed and in PATH.

Preprocessing

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.

Training

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.

Running

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>

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Using a CNN to identify chess pieces

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages