--- license: cc-by-nc-4.0 pretty_name: ChessFlow task_categories: - image-classification tags: - chess - computer-vision - image-to-fen - youtube size_categories: - 10K=2,<3" "yt-dlp>=2026.10.26"; python crop_chessflow.py ... ``` `av` and OpenCV are pinned to the versions the dataset's `crop_hash` values were made with, as other versions can decode or resize frames to slightly different pixels. The headless OpenCV build gives the same pixels as the full one, and installs without GUI libraries. It writes `chessflow_crops/{train,validation,test}/.jpg` with a `metadata.jsonl` beside them, so the crops load with `datasets.load_dataset("imagefolder", data_dir="chessflow_crops")`. It needs ffmpeg. Videos taken down from YouTube since are skipped. Each crop is checked against the dataset's `crop_hash`, and a video whose crops don't match (a download of another encoding, or frames out of step) is reported. ## Splits | Split | Frames | Positions | Games | Videos | | :--- | ---: | ---: | ---: | ---: | | train | 13,812 | 5,554 | 100 | 100 | | validation | 1,816 | 789 | 13 | 13 | | test | 1,788 | 845 | 13 | 13 | Splits are by whole video: no video is in two. Test and then validation are each 10% of the frames, as whole videos picked by a hash of their ids. Each video holds one game. ## Frames (`frames`, the default) | Field | Type | Description | | :--- | :--- | :--- | | `id` | string | `_`, unique | | `video_id` | string | The YouTube video id | | `youtube_url` | string | `https://www.youtube.com/watch?v=` | | `game` | int | Which game of the video, from 1 (always 1 here) | | `frame` | int | The frame's index in the video, from 0, decoding every frame in order | | `time` | float | The frame's time in the video, in seconds (`frame / fps`) | | `fen` | string | The piece placement, the first field of a FEN (`rnbqkbnr/pppppppp/8/...`), rank 8 first | | `ply` | int | Moves played to reach the position (1 after White's first move) | | `since_move` | float | Seconds since the board changed to this position | | `until_move` | float or null | Seconds until the board next changes; null for a game's last position | | `board_box` | int[4] | The board region to crop, `[x, y, width, height]` in the video's pixels, within the frame | | `overlay_box` | int[4] | The 2D board's region, `[x, y, width, height]`. It shows the answer, so any part of it inside the crop is blacked out | | `video_width`, `video_height` | int | The size of the video the boxes are for (1280 × 720, or 1278 × 720 for one video) | | `fps` | float | The video's frame rate (30, or 60 for two videos) | | `model_agreement` | int | Squares (of 64) that a chess-reading model read as the label says | | `crop_hash` | string | A 64-bit difference hash of the crop (`dhash` in `crop_chessflow.py`), as 16 hex digits | The FEN is the board as it stands in the frame, with the board in whatever orientation the camera shows it. `since_move` and `until_move` are from when the board changed, which is about 0.1 s before the 2D board showed the move (the median over 9,810 moves). A frame is never closer than 0.5 s after a move or 2 s before one. `crop_hash` tells a crop made again from YouTube apart from the dataset's when the frame or region is wrong, not when it is a frame or two off: the board barely changes between frames. ## Games (`games`) One row per game that has frames in the split, for move tracking: following a game through its video and reading off the moves. | Field | Type | Description | | :--- | :--- | :--- | | `id` | string | `_game_` | | `video_id`, `youtube_url`, `game` | | As in `frames` | | `moves` | string[] | The moves, in UCI (`e2e4`) | | `san` | string[] | The same moves in SAN (`e4`) | | `move_frames` | int[] | The frame of the video at which the 2D board showed each move | | `move_times` | float[] | The same, in seconds | | `final_fen` | string | The piece placement after the last move | | `pawns_left` | object[] | Promotions where the pawn was left on the board (none are marked here): `ply`, and `swapped_at`, the second it was swapped for the new piece, or null if it stood until its square next changed | The 2D board shows a move about 0.1 s after it is made on the board. As the videos cut between parts of a game, a game's moves can be shown faster than they were played. ## How the frames were chosen The moves and their times were read from the 2D board in each video, by following the game from its start position with a classifier of the 2D board's squares. The channel's 2D boards come in several colour schemes; on the darker ones that classifier reads some White pieces as Black, so for 17 videos the board's colours were repainted to the ones it reads best before reading, and for 12 a whole-board model (ChessQ Lite) read them instead. Games whose last read position didn't match the 2D board's were left out. Frames are only taken while a position stood still: none from 2 s before a move to 0.5 s after it, when a piece is in the air or in a hand. Each position gives up to 3 frames, spread over the time it stood, and each game up to 150, so long games don't outweigh short ones. Hands over the board are kept, as what they hide is still on it. Each frame's label was checked against a chess-reading model (`model_agreement`): a frame it disagrees with on more than 16 squares was dropped, as that is a takeback, a camera cut or the board being reset rather than a hard frame, and a game losing over 20% of its frames was left out. Frames it read a few squares wrong are kept, as those are the hard ones. The labels are automatic, so some are wrong: a move the 2D board showed late or early, or a square the board region cuts off. ## License The labels and boxes are released under [CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/). The videos are not part of the dataset and belong to their owners (ChessFlow, and the broadcasters of the events); crops made from them are subject to YouTube's terms and their rights.