Skip to content

jonkoi/chess_detection

Repository files navigation

chess_detection

About

For chessboard grid detection:

For piece detection:

  • Data generation using LabalImg (a lot of time spent)
  • Fine tune pretrained faster_rcnn_resnet50_coco from object detection api

Files:

  • detection.py : piece detection
  • main.py : X-corner detection, grid-fitting, integration with piece detection
  • gui.py : runnable file to use this pipeline
  • test.py : bulk testing of images in test folder
  • ...

Dependencies (not too sure)

  • Python 3.6
  • OpenCV3
  • tensorflow including tensorflow's models repo
  • protoc
  • PIL
  • numpy
  • scipy
  • svglib
  • reportlab
  • pandas
  • ...

How to use

git clone git@github.com:jonkoi/chess_detection.git
cd chess_detection
git clone git@github.com:tensorflow/models.git
cd models/research
protoc object_detection/protos/*.proto --python_out=.
set PYTHONPATH=PATH\TO\models\research;PATH\TO\models\research\slim (for windows)
cd ../..

For simgle images:

python gui.py

For bulk testing of test images:

python test.py

Example result



Here is video of the test.

Disclaimer

The piece detection module uses deep learning (not mobilenet) which can make inference very slow. The process is sluggish even with a GTX860M.

About

Computer vision project for class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages