Code Monkey home page Code Monkey logo

chess-vision's Introduction

chess-vision

chessvision calculates the state of a real chessboard from a video stream. Necessary if we are to unleash computers superhuman chess ability into the real world, but also an excuse to train some computer vision models and collect my own dataset!

Limitations:

  • Output is only concerned with the board state (not position of pieces in world space)
  • Camera is assumed to be mounted directly above the chess board (small perspective shift is accounted for, but extreme angles with occlusion will be a problem)
  • Only one chess board is used in pre-trained model (other boards can be used but model will need to be retrained)

guild was used in this project for experiment tracking. Highly recommend you go check it out if you haven't already.

A demo of the inference application

Generates PGN: 1. f4 e5 2. g4 Qh4# 0-1

Exploring The Code

Auto-Labelling

  1. Visit game.py to see how one "unit" of data is stored
  2. Visit label.py for the actual auto-labelling functions using python-chess
  3. Use record.py and replay.py to record your own games

Training

  1. Visit train.py for a view of the training script
  2. Visit models.py to see some of the models that were tested

Inference

  1. Explore inference.py to see how the pre-trained models are used at runtime with the concepts of VisionState and BoardState

chess-vision's People

Contributors

mulac avatar

Stargazers

 avatar Sam Parker avatar  avatar Sam Barnes avatar Edward Digby avatar Evan James avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.