Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
pipeline_tag: reinforcement-learning
|
| 6 |
+
tags:
|
| 7 |
+
- counter-strike-2
|
| 8 |
+
- trajectory-prediction
|
| 9 |
+
- transformer
|
| 10 |
+
- esports
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# CS-NET v4 — CS2 Path Prediction & Spatial-Only Models
|
| 14 |
+
|
| 15 |
+
Trained checkpoints for **CS-NET v4** — a Transformer-based framework for
|
| 16 |
+
Counter-Strike 2 game-state forecasting. Full open-source code (training,
|
| 17 |
+
inference, 3D visualizer) is available at
|
| 18 |
+
**[github.com/Gary2005/cs-net](https://github.com/Gary2005/cs-net)**.
|
| 19 |
+
|
| 20 |
+
All checkpoints use the **Pro architecture** (d_model=768, ~138.7M params),
|
| 21 |
+
see `config/pretrain-a100-pro.yaml` in the source repo.
|
| 22 |
+
|
| 23 |
+
## Files
|
| 24 |
+
|
| 25 |
+
| File | Task | Description |
|
| 26 |
+
|---|---|---|
|
| 27 |
+
| `cs-net-v4-pro.pt` | Path prediction (pre-training) | 600k steps. Full model: `{model, global_step}`. Auto-regressively predicts each player's future movement path (16 ticks = 4 s) from a window of the full game state (10 players + bomb + projectiles + raycast depth maps). |
|
| 28 |
+
| `pretrain-v4-pro-win_rate.pt` | Spatial-only `winrate` | Per-player team win probability from a **single tick** of the game state. `{task, model_state, head_state, config}` — embedder + spatial transformer + linear head. |
|
| 29 |
+
| `pretrain-v4-pro-alive_end.pt` | Spatial-only `alive_end` | Per-player probability of being alive at round end. Same format. |
|
| 30 |
+
| `pretrain-v4-pro-future_kill.pt` | Spatial-only `future_kill` | Per-player probability of getting a kill after the current tick. Same format. |
|
| 31 |
+
|
| 32 |
+
## Quick start
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
git clone https://github.com/Gary2005/cs-net.git
|
| 36 |
+
cd cs-net
|
| 37 |
+
conda create -n cs2demo python=3.10 && conda activate cs2demo
|
| 38 |
+
pip install -r requirements.txt
|
| 39 |
+
pip install huggingface_hub
|
| 40 |
+
|
| 41 |
+
# download all 4 checkpoints
|
| 42 |
+
python scripts/download_checkpoints.py --repo-id gary2oos/cs-net-v4
|
| 43 |
+
|
| 44 |
+
# verify they load correctly (architecture match, finite weights, forward pass)
|
| 45 |
+
python scripts/test_checkpoints.py --models-dir checkpoints
|
| 46 |
+
```
|
| 47 |
+
|
| 48 |
+
### Inference
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
# Path prediction
|
| 52 |
+
from scripts.prediction_engine import PredictionEngine
|
| 53 |
+
engine = PredictionEngine("config/pretrain-a100-pro.yaml",
|
| 54 |
+
"checkpoints/cs-net-v4-pro.pt",
|
| 55 |
+
device="cpu", maps_dir="maps/optimized_obj_files")
|
| 56 |
+
result = engine.predict_at_tick(sample, query_tick=120) # sample = round-level dict
|
| 57 |
+
|
| 58 |
+
# Spatial-only (winrate / alive_end / future_kill)
|
| 59 |
+
from scripts.spatial_only_predictor import SpatialOnlyPredictor
|
| 60 |
+
predictor = SpatialOnlyPredictor("checkpoints", device="cpu")
|
| 61 |
+
out = predictor.predict_round_full(sample) # per-tick per-player probabilities
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### 3D visualizer
|
| 65 |
+
|
| 66 |
+
```bash
|
| 67 |
+
python visualizer/server.py --port 5000 \
|
| 68 |
+
--checkpoint checkpoints/cs-net-v4-pro.pt \
|
| 69 |
+
--spatial-model-dir checkpoints \
|
| 70 |
+
--device cpu
|
| 71 |
+
# open http://127.0.0.1:5000/
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
## License
|
| 75 |
+
|
| 76 |
+
MIT (see source repo).
|