Show HN: I built an app that scans 2D chessboard to get Stockfish chess analysis
I've been fascinated by chess for years , and always wanted to build a commercial app related to chess. So here is my humble attempt at that.
The app scans 2D chessboards using your camera, then runs Stockfish analysis on the position.
Here's how it works technically:
- We do segmentation first to crop the chessboard from the full image.
- Then we perform object detection to identify individual pieces
- Bounding box analysis for board alignment and perspective correction. This gives us a matrix 8 x 8 which represents the chessboard.
- We convert this position to FEN (Forsyth-Edwards Notation)
- Pass this FEN string to stockfish engine to get engine analysis.
The object detection model is reasonably good to the point where I thought of making the app public, but it isn’t 100% always and hence there is also an edit board option to handle it.
Right now I used a small dataset to train the object detection model. Labelled the pieces with bounding boxes using label studio and it’s a standard YOLO model. I am pretty confident on improving the model further with more data.
Try it:
iOS: https://apps.apple.com/us/app/stockfish-chess-analysis/id674...
App is behind a paywall as I need to run a server for inference. But there is a generous free tier for anyone who wants to give the app a go.
Would love feedback on the app and the underlying tech!
No comments yet