You need to agree to share your contact information to access this dataset

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this dataset content.

ChessAI Data — Chinese Chess Piece Detection

A bounding-box detection dataset for Chinese Chess (Cờ tướng / 象棋), labeled with AnyLabeling. Built to train piece-recognition models for chessboard-state extraction from photos.

Dataset summary

  • Total annotated images: 1,747 (per-image AnyLabeling JSON in data/combined_data/)
  • COCO-format split: 872 images, 18,790 bounding boxes (data/annotations.json)
  • Classes: 7 (the standard Xiangqi piece set)
  • Total size: ~280 MB (images + annotations)

Classes

Vietnamese piece names are used throughout. Counts below are from the COCO split.

ID Label (VN) Piece Boxes
1 xe Chariot (rook) 2,264
2 ma Horse (knight) 2,357
3 tuong Elephant (bishop-like) 2,350
4 si Advisor (palace guard) 2,375
5 vua General (king) 1,244
6 phao Cannon 2,369
7 tot Soldier (pawn) 5,831

Files

  • data/combined_data/ — paired .jpg + .json files in labelme / AnyLabeling format. Each .json has a shapes[] array with label, points (top-left and bottom-right corners), and shape_type: "rectangle".
  • data/annotations.json — COCO-format export covering 872 images and 18,790 boxes, ready for use with detection libraries that expect COCO.
  • data/data_01/, data/data_02/ — raw images grouped by capture session.
  • make_data.sh — pipeline that produces the COCO export from the raw + per-image annotation pairs.

Quick start — load the COCO split

from huggingface_hub import hf_hub_download
import json

path = hf_hub_download(
    repo_id="vietanhdev/chessai-data",
    filename="data/annotations.json",
    repo_type="dataset",
)
with open(path) as f:
    coco = json.load(f)

print(len(coco["images"]), "images,", len(coco["annotations"]), "boxes")
print("classes:", [c["name"] for c in coco["categories"]])

To download images alongside, use snapshot_download with allow_patterns=["data/combined_data/*"].

Reproducing the dataset

conda create -n chessai-dataprep python=3.9
conda activate chessai-dataprep
pip install -r requirements.txt
# After labeling raw images in data/data_01 and data/data_02 with AnyLabeling:
bash make_data.sh

Source code

Upstream repo with preprocessing scripts: https://github.com/nrl-ai/chessai-data

Citation

@misc{nguyen2024chessai,
  author    = {{Viet-Anh NGUYEN (Andrew)}},
  title     = {ChessAI Data — Chinese Chess piece detection dataset},
  year      = {2024},
  publisher = {Hugging Face},
  doi       = {10.57967/hf/2812},
  url       = {https://huggingface.co/datasets/vietanhdev/chessai-data}
}
Downloads last month
8