LiteRT
LiteRT
Safetensors
chessqueries
chess
computer-vision
image-to-fen

ChessQ ChessCam

ChessQ Lite fine-tuned on footage from ChessCam games and exported to LiteRT for the browser. It comes in two input sizes: 644 × 644, and 448 × 448, which is about 2.5 times faster for a small loss of accuracy (see the comparison). The ChessCam web app uses the 448 model.

Built with ChessQueries (paper).

Files

File Input Format
chessq-chesscam-fp16.tflite 644 × 644 LiteRT, FP16 weights (64.3 MB)
chessq-chesscam-fp32.safetensors 644 × 644 PyTorch, FP32 weights (126 MB)
chessq-chesscam-448-fp16.tflite 448 × 448 LiteRT, FP16 weights (62.6 MB)
chessq-chesscam-448-fp32.safetensors 448 × 448 PyTorch, FP32 weights (126 MB)

All four are ViT-S ChessQueries models. The .tflite files run with LiteRT.js on WebGPU or on the CPU (WebAssembly). The .safetensors files are in the ChessQueries checkpoint format. Each model only works well at the input size it was trained at.

On an RTX 3060 laptop GPU with LiteRT.js 2.6.0 in Chrome (WebGPU, FP16), one run of the 448 model takes a median of 27 ms, and one run of the 644 model takes 67 ms. These times include reading the outputs back, but not uploading the input.

Quick start (PyTorch)

With Python 3.12:

python -m pip install "git+https://github.com/JSeytre/chessqueries.git@f5aaaf38212cc7839b03ccf383455053905b3f7e"
chessqueries-predict photo.jpg --checkpoint chessq-chesscam-fp32.safetensors
chessqueries-predict photo.jpg --checkpoint chessq-chesscam-448-fp32.safetensors --resolution 448

Input and output

  • Input: uint8 (1, S, S, 4), RGBA pixels (for example, canvas ImageData.data as is), where S is 644 or 448 depending on the model. The image is resized to S × S without keeping its aspect ratio. Normalisation happens inside the model.
  • Outputs (their order is up to the runtime, so tell them apart by shape):
    • float32 (1, 64, 13): softmax probabilities for each square, with squares in FEN order (a8, b8, …, h1). The classes are . P N B R Q K p n b r q k, where . is an empty square.
    • float32 (1, 64, 2): where each square's query attends in the input image, as (x, y) in [0, 1], squares in the same order. It is the attention-weighted centre of the image patches in the last decoder layer's cross-attention, so it is pulled towards the board centre: use it for directions (for example, which way rank 8 lies), not exact square positions.

Training

The model starts from the released ChessQ Lite V4 weights and was trained for 4 epochs on the ChessReD and ChessCog training splits plus a ChessCam dataset of 15,590 frames from recorded games. The ChessCam labels were made by converting the app's piece boxes and board grids to FENs.

The 448 model starts from the 644 model's weights and was trained for 4 more epochs on the same data at 448 × 448.

Comparison with ChessQ Lite

Test-set results for these models and ChessQ Lite, all run in PyTorch with FP32 arithmetic, each at its own input size.

Test set Boards Metric ChessQ Lite (644) ChessQ ChessCam (644) ChessQ ChessCam (448)
ChessCam 2,275 Exact board 14.4% 38.8% 38.1%
At most 1 square wrong 33.1% 72.3% 71.5%
Squares correct 94.86% 98.25% 98.20%
ChessReD 2,129 Exact board 98.6% 98.6% 96.5%
At most 1 square wrong 99.8% 99.9% 99.6%
Squares correct 99.97% 99.98% 99.93%
ChessCog 342 Exact board 97.4% 97.4% 97.1%
At most 1 square wrong 100.0% 100.0% 100.0%
Squares correct 99.96% 99.96% 99.95%

The ChessCam test videos are not in the training set. The test set only keeps frames where ChessQ Lite agrees with the labels on at least 48 of 64 squares, which favours ChessQ Lite and may not represent every kind of ChessCam footage. The .tflite files use FP16 weights, so their results may differ slightly.

License

These weights are a modified version of ChessQ Lite and are licensed under the PolyForm Noncommercial License 1.0.0. They may be used, modified and redistributed for permitted noncommercial purposes; commercial use requires separate permission from the ChessQueries authors. Third-party components keep their upstream terms; see the notices.

Required Notice: Copyright (c) 2026 Joël Seytre.

Downloads last month
226
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for PBatch23888/chessq-chesscam

Finetuned
(1)
this model

Paper for PBatch23888/chessq-chesscam