Gary2005/cs-net
Tentang
CS-NET is a Transformer-based deep learning framework for analyzing Counter-Strike 2 match replays (.dem demo files).
AI dan pembelajaran mesinPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- +3
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asli
CS-NET 
A CS2 3D AI analysis and replay tool
中文 · Quick start · Download models · Using the web app · Repository layout · Docs · Licensing
What this is
cs-net v5 is an AI analysis tool that runs locally, with 3D replay built in.
Quick start
Requirements: Python ≥ 3.10, and a Go toolchain (only to build the smoke/fire side-channel, once).
git clone https://github.com/Gary2005/cs-net.git
cd cs-net
conda create -n cs-net-v5 python=3.10 -y
conda activate cs-net-v5
pip install -r requirements.txt
# 1) build the Go side-channel (smoke voxels + fire cells, once per machine)
bash tools/demo_extract/build_sidechannel.sh # PowerShell: bash is Git Bash's
# 2) unpack the map geometry (maps/*.obj.zip -> *.obj, ~1 GB on disk)
python scripts/extract_maps.py
# 3) run the app
python -m app.server --port 5000 # → http://127.0.0.1:5000/library
Step 2 can also be done in the browser: while maps/ is still packed, the library
page shows an 解压地图 / Unpack maps banner, and one click queues the same
script. Like the weights, it is a one-time thing per checkout.
No environment? Download the zip
Every release ships two Windows x64 zips that need neither Python nor conda:
cs-net-5.1.2-win64-lite.zip— no weights; the AI panel downloads them (665 MB) the first time you click the banner;cs-net-5.1.2-win64-full.zip— weights included, works offline.
Unpack, double-click cs-net.exe, done. The map geometry is already unpacked in
both, and the library/config.json/.csz live in the data\ folder next to the
exe, so moving the folder moves everything. Details:
packaging/README.md.
Download the AI models
The two checkpoints behind the AI panels are 665 MB together and do not belong in git, so they live on Hugging Face. Download them once, either way:
- in the app: open the library page and click 下载模型 / Download models in the
banner that appears when
models/is missing something; - from the CLI:
python scripts/download_models.py.
Both run the same script, which is built on huggingface_hub (resume and
checksums included). It probes huggingface.co first and, when that is
unreachable, switches HF_ENDPOINT to hf-mirror.com automatically — the
same thing as exporting HF_ENDPOINT=https://hf-mirror.com yourself. --mirror
forces the mirror, --endpoint URL pins a host, and --check reports what is
missing without downloading anything.
python scripts/check_env.py verifies the whole environment (Python, modules,
side-channel binary, browser, unrar); run it if something looks off.
Using the web app
- Add a watch folder — top bar → 设置 / Settings → paste the directory
that holds your demos (candidates found on this machine are listed) → Save
→ 扫描 / Scan. The library starts empty on purpose: the folder has to be
yours.
No folder to watch? 上传 / Upload in the top bar takes one or more
.demfiles (or a 5E.zip), or drag them onto the page: they are copied intodata\imports\, and a demo whose content is already in the library is recognised and skipped instead of being parsed again. - Wait for extraction — each
.dembecomes a.cszin the background (110 MB → ~7 MB). Progress shows in the list and in the 任务 / Tasks drawer. - Watch it back — tick one or more demos → 载入分析 / Load analysis → the 3D replay page: players, grenades, smoke volumes, fire cells, kill feed, minimap, visibility.
- Browse players — the 玩家 / Players page aggregates every demo in the library; each profile has aim/impact stats, and a AI 数据 / AI stats tab. 加入关注 / Watch follows the Steam account, not the name, so the same person stays highlighted whichever platform (or in-game name) they play under.
- Turn on AI — bottom of the replay page: AI 预测面板 (round win chance, per-player five heads) and AI 对枪 (who wins the next duel, as an arc).
- Share — the match stats dialog and the player profile both have a 分享图片 / Share image button that exports a PNG with the logo and the project link. Warmup kills are excluded from every number: some platforms (5E) record the pre-match warmup, which used to double round 0's K/D.
Repository layout
app/ The web app: demo library, player pages, AI panels (Flask + SQLite)
visualizer/ 3D replay studio (Flask + Three.js) — also the site logo
tools/demo_extract/ .dem -> .csz extractor: per-tick, zstd, smoke/fire decoders
training/ PyTorch models and trainers (what the AI panels load)
scripts/training_data/ .csz -> task datasets for training
scripts/ Helpers: download_models.py, extract_maps.py, check_env.py, export_weights.py
packaging/ PyInstaller spec + zip script for the double-click Windows build
maps/optimized_obj_files/ Decimated map geometry (.obj.zip — unpack with extract_maps.py)
models/ The two pinned checkpoints (git-ignored, downloaded)
The .csz codec is exact: codec.save → codec.load is bit-identical
(codec.equal), not approximate. The extractor samples every tick (≈64 Hz) and
reads smoke voxels and fire cells through a small Go side-channel for the fields
demoparser2 cannot reach.
Docs
| Doc | Contents |
|---|---|
| app/README.md | Demo library, thumbnails, player pages, AI panels, HTTP API |
| visualizer/README.md | Replay studio behaviour and internals |
| tools/demo_extract/README.md | .csz field tree, sampling modes, smoke voxels, fire cells |
| tools/demo_extract/API.md | Field-level reference, measured magnitudes, pitfalls |
| scripts/training_data/README.md | Writing a task, slicing samples, dataset pitfalls |
| packaging/README.md | The double-click Windows build: spec, sizing, release workflow |
Licensing
The code in this repository is MIT — see LICENSE.
The game content is not. visualizer/static/assets/ (weapon models,
textures, smoke/fire sprites, HUD icons, radar images) and the geometry in
maps/optimized_obj_files/ are derived from Valve's Counter-Strike 2 content,
© Valve Corporation.
Jelajahi proyek terkait
Memuat…