File size: 7,162 Bytes
86d0506
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
---
license: cc-by-4.0
task_categories:
  - video-classification
  - other
language:
  - en
tags:
  - counter-strike
  - cs2
  - esports
  - hltv
  - video
  - audio
  - parquet
  - reinforcement-learning
pretty_name: "OpenCS2 — POV Renders"
configs:
  - config_name: previews
    data_files:
      - split: train
        path: data/**/chunks-preview-*.parquet
    default: true
  - config_name: matches
    data_files:
      - split: train
        path: index/manifest-*.parquet
  - config_name: rounds
    data_files:
      - split: train
        path: index/rounds-*.parquet
  - config_name: chunks
    data_files:
      - split: train
        path: data/**/chunks-full-*.parquet
---

![OpenCS2](https://huggingface.co/spaces/blanchon/counter-strike-2-dataset-viewer/resolve/main/static/header.webp)

# OpenCS2 — POV Renders

> **Browse with the [OpenCS2 Viewer](https://huggingface.co/spaces/blanchon/counter-strike-2-dataset-viewer)** — every match, map and round, with all 10 player POVs synced on one timeline.

Tick-aligned Counter-Strike 2 POV training clips, rendered from
[`blanchon/cs2_dataset_demo`](https://huggingface.co/datasets/blanchon/cs2_dataset_demo). Each row is
≤1 minute of one player's perspective; ten POVs per round share the same tick clock.

Per chunk:

- **Video** — 1280×720 @ 32 fps, near-lossless H.264.
- **Audio** — per-player stereo, mixed from that player's position and orientation.
- **Inputs** — every tick: keys, mouse delta, view angles, fire/jump/use, weapon switches.
- **World state** — every tick, all 10 players: position, velocity, view, health, armor, weapon, alive flag.

---

## Usage

Four configs. `previews` is the cheap default; `chunks` is the heavy training data.

| Config               | Row                                                              | Use                       |
| -------------------- | ---------------------------------------------------------------- | ------------------------- |
| `previews` (default) | low-res `preview.mp4` + 1 Hz inputs/world sidecars               | browsing, sanity checks   |
| `chunks`             | path-only `video.mp4` + `audio.wav`, embedded inputs/worlds      | training                  |
| `matches`            | one per `(match_id, map_name)` with team/event metadata          | filtering / index         |
| `rounds`             | one per `(match_id, map_name, round)` with tick boundaries       | filtering / index         |

### Stream with `datasets`

```python
from datasets import load_dataset

# Default browsing view
previews = load_dataset("blanchon/cs2_dataset_render_part2", split="train", streaming=True)

# Training rows. Pass columns/filters at load time so the parquet reader pushes them down.
chunks = load_dataset(
    "blanchon/cs2_dataset_render_part2", "chunks",
    split="train", streaming=True,
    columns=["video", "audio", "inputs", "worlds", "match_id", "round", "player"],
    filters=[("player", "==", 0)],
)
```

### Query with DuckDB

```sql
INSTALL httpfs; LOAD httpfs;

-- Match index
SELECT match_id, map_name, team1, team2, event, match_date
FROM 'hf://datasets/blanchon/cs2_dataset_render_part2/index/manifest-*.parquet'
WHERE event ILIKE '%IEM%';

-- Long rounds only
SELECT match_id, map_name, round, round_duration_ticks
FROM 'hf://datasets/blanchon/cs2_dataset_render_part2/index/rounds-*.parquet'
WHERE round_duration_ticks > 3000;

-- Preview rows, filter by AWP plays (cheap visual triage)
SELECT match_id, round, player, chunk_index, primary_weapon
FROM 'hf://datasets/blanchon/cs2_dataset_render_part2/data/**/chunks-preview-*.parquet'
WHERE primary_weapon = 'AWP';
```

### Partial download with the `hf` CLI

Hive partitioning lets you target a single match/map/player without touching the rest:

```bash
# Index files only (~MB, scan-friendly)
hf download blanchon/cs2_dataset_render_part2 --repo-type dataset --include "index/*.parquet"

# All previews for one match
hf download blanchon/cs2_dataset_render_part2 --repo-type dataset \
    --include "data/match_id=2393343/**/chunks-preview-*.parquet" \
    --include "data/match_id=2393343/**/previews/**"

# Full chunks (video+audio+parquet) for one player on one map
hf download blanchon/cs2_dataset_render_part2 --repo-type dataset \
    --include "data/match_id=2393343/map_name=de_ancient/player=0/**"
```

---

## Structure

### Repository layout

```
data/
  match_id=<id>/map_name=<map>/player=<0-9>/
    chunks-preview-<machine>-<uuid>.parquet
    chunks-full-<machine>-<uuid>.parquet
    chunks/chunk_<n>/{video.mp4, audio.wav}
    previews/chunk_<n>/{preview.mp4, inputs.preview.json, world.preview.jsonl}
index/
  manifest-<machine>-<uuid>.parquet     # one row per (match, map)
  rounds-<machine>-<uuid>.parquet       # one row per (match, map, round)
```

Hive `key=value` directories prune at the path level. Media files are loose; the
parquets store relative `*_path` columns plus an `hf://...` URI for the Hub
dataset viewer. Parallel render workers each write their own `<machine>-<uuid>`
shard so uploads never collide.

### Row semantics

- `player` is the canonical 0-9 player index, stable for a match.
- `spec_slot` is the transient CS2 spectator slot used to capture the POV — useful only for debugging.
- Recording starts at the playable round start (`freeze_end_tick`). Death POVs keep a short
  death tail clamped to round end; survivor POVs keep a short post-round tail, so final
  kill/round-win feedback is not clipped. POVs in the same round can have different durations.
- `inputs` and `worlds` are struct-of-arrays in the chunks parquet — `row["worlds"]["X"]` returns
  the per-tick X position list for all 10 players.
- Hot filter columns on `chunks`: `match_id`, `map_name`, `player`, `round`, `chunk_index`,
  `primary_weapon`, `player_side`, `survived_chunk`, `damage_taken`, `shots_fired`,
  `distance_traveled`, `weapons_used`.

---

## Creation

Built with the recorder in <https://github.com/julien-blanchon/opencs2-dataset>:

1. **Demos** — pulled from [`blanchon/cs2_dataset_demo`](https://huggingface.co/datasets/blanchon/cs2_dataset_demo).
2. **Render** — a headless CS2 + custom plugin replays each demo, captures every player POV
   tick-by-tick, and streams raw frames to NVENC. Validated end-to-end:
   `start_tick == requested`, frame count matches the tick range.
3. **Parquet** — chunks (≤1 min) sorted by `(round, chunk_index)`, written with
   `row_group_size=1`, `write_page_index=True` and `use_content_defined_chunking=True`
   so re-uploads of touched chunks transfer near-zero bytes via Xet.
4. **Upload** — each render worker writes its own `<machine>-<uuid>` shard via
   `upload_large_folder` with `hf_transfer` + `hf_xet`.

---

## Licensing & Usage

`.dem` source data is mirrored from HLTV; downstream use is bound by the original
tournament terms. Renders + metadata: **CC-BY-4.0**.

---

## Citation

```bibtex
@misc{blanchon2026opencs2,
  author       = {Julien Blanchon},
  title        = {OpenCS2 Dataset},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://github.com/julien-blanchon/opencs2-dataset}}
}
```