Skip to content

Commit 3fef940

Browse files
committed
feat: publish KPL tactical analysis toolkit
1 parent bf0cba3 commit 3fef940

47 files changed

Lines changed: 18268 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto
2+
*.bat text eol=crlf
3+
*.py text eol=lf
4+
*.js text eol=lf
5+
*.ts text eol=lf
6+
*.tsx text eol=lf
7+
*.css text eol=lf
8+
*.md text eol=lf
9+
*.yml text eol=lf
10+
*.yaml text eol=lf
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Bug 报告
2+
description: 报告可复现的识别、界面或运行问题
3+
title: "[Bug] "
4+
labels:
5+
- bug
6+
body:
7+
- type: markdown
8+
attributes:
9+
value: |
10+
感谢反馈。请勿上传未获授权的比赛录像、真实分析数据、访问令牌或包含个人目录的日志。
11+
- type: dropdown
12+
id: component
13+
attributes:
14+
label: 问题模块
15+
options:
16+
- 英雄头像校准
17+
- 位置识别与轨迹关联
18+
- 批量视频处理
19+
- 队伍与分路配置
20+
- 区域概率统计
21+
- 数据导出
22+
- 本地启动或依赖
23+
- Web 交互原型
24+
- 其他
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: summary
29+
attributes:
30+
label: 问题描述
31+
description: 说明实际行为、预期行为以及问题造成的影响。
32+
validations:
33+
required: true
34+
- type: textarea
35+
id: reproduce
36+
attributes:
37+
label: 复现步骤
38+
placeholder: |
39+
1. 启动……
40+
2. 输入……
41+
3. 在……秒校准
42+
4. 看到……
43+
validations:
44+
required: true
45+
- type: textarea
46+
id: video
47+
attributes:
48+
label: 素材与参数
49+
description: 请仅填写元数据;不要直接上传无权公开的完整视频。
50+
placeholder: |
51+
分辨率与方向:
52+
编码格式:
53+
视频时长:
54+
校准秒数:
55+
回放倍速:
56+
开局偏移:
57+
采样间隔:
58+
- type: textarea
59+
id: environment
60+
attributes:
61+
label: 运行环境
62+
placeholder: |
63+
操作系统:
64+
Python 版本:
65+
浏览器:
66+
CPU:
67+
validations:
68+
required: true
69+
- type: textarea
70+
id: evidence
71+
attributes:
72+
label: 日志或脱敏截图
73+
description: 粘贴前请移除用户名、绝对路径、账号信息和受版权保护的内容。
74+
render: shell
75+
- type: checkboxes
76+
id: checks
77+
attributes:
78+
label: 提交前确认
79+
options:
80+
- label: 我已搜索现有 Issue,未发现相同问题。
81+
required: true
82+
- label: 我已移除隐私信息、凭证和无权公开的素材。
83+
required: true
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: 功能建议
2+
description: 提议新的分析能力、工作流或性能改进
3+
title: "[Feature] "
4+
labels:
5+
- enhancement
6+
body:
7+
- type: textarea
8+
id: problem
9+
attributes:
10+
label: 要解决的问题
11+
description: 描述当前工作流中的具体困难,不要只描述实现方案。
12+
validations:
13+
required: true
14+
- type: textarea
15+
id: proposal
16+
attributes:
17+
label: 建议方案
18+
description: 说明用户交互、输入、输出和预期效果。
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: alternatives
23+
attributes:
24+
label: 备选方案
25+
description: 如果考虑过其他做法,请说明取舍。
26+
- type: dropdown
27+
id: compatibility
28+
attributes:
29+
label: 是否影响现有数据格式或统计口径
30+
options:
31+
- 不影响
32+
- 可能影响,需要讨论
33+
- 会影响,建议升级格式版本
34+
validations:
35+
required: true
36+
- type: textarea
37+
id: validation
38+
attributes:
39+
label: 如何验证
40+
description: 建议可量化的准确率、性能或可用性验收方式。
41+
- type: checkboxes
42+
id: checks
43+
attributes:
44+
label: 提交前确认
45+
options:
46+
- label: 我已搜索现有 Issue,未发现相同建议。
47+
required: true
48+
- label: 此建议不要求在仓库中加入未授权视频或真实用户数据。
49+
required: true

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
## 变更目的
2+
3+
<!-- 说明要解决的问题,并关联 Issue,例如 Closes #123。 -->
4+
5+
## 实现说明
6+
7+
<!-- 简述关键设计、主要改动和未采用方案。 -->
8+
9+
## 验证结果
10+
11+
<!-- 列出实际执行的命令和结果;轨迹算法改动请附上耗时与准确性对照。 -->
12+
13+
- [ ] `python -m unittest tests/test_local_app.py`
14+
- [ ] `python -m py_compile local_app.py`
15+
- [ ] `node --check local-ui/app.js`
16+
- [ ] `npm test`(修改 Web 原型时)
17+
18+
## 数据与兼容性
19+
20+
- [ ] 未提交视频、`local-data/`、分析导出、凭证或个人绝对路径。
21+
- [ ] 数据字段或区域口径未变化;如有变化,已说明兼容策略。
22+
- [ ] 用户流程、字段或规则变化已同步更新文档。
23+
- [ ] 新行为有自动测试或可复现的人工验证记录。
24+
25+
## 截图或测试素材
26+
27+
<!-- 可选。仅添加已获授权且完成脱敏的内容。 -->

‎.github/workflows/ci.yml‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
local-analyzer:
14+
name: Local analyzer
15+
runs-on: windows-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
cache: pip
22+
- name: Install Python dependencies
23+
run: python -m pip install -r requirements-local.txt
24+
- name: Run backend tests
25+
run: python -m unittest tests/test_local_app.py
26+
- name: Check Python syntax
27+
run: python -m py_compile local_app.py
28+
- uses: actions/setup-node@v4
29+
with:
30+
node-version: "22.13.0"
31+
- name: Check local UI syntax
32+
run: node --check local-ui/app.js
33+
34+
web-prototype:
35+
name: Optional web prototype
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-node@v4
40+
with:
41+
node-version: "22.13.0"
42+
cache: npm
43+
- run: npm ci
44+
- run: npm test

‎.gitignore‎

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.npm-cache/
6+
/.pip-cache/
7+
/.venv/
8+
/local-data/
9+
/.pnp
10+
.pnp.*
11+
.yarn/*
12+
!.yarn/patches
13+
!.yarn/plugins
14+
!.yarn/releases
15+
!.yarn/versions
16+
17+
# testing
18+
/coverage
19+
20+
# next.js
21+
/.next/
22+
/.vinext/
23+
/out/
24+
25+
# misc
26+
.DS_Store
27+
*.pem
28+
29+
# debug
30+
npm-debug.log*
31+
yarn-debug.log*
32+
yarn-error.log*
33+
.pnpm-debug.log*
34+
35+
# env files (can opt-in for committing if needed)
36+
.env*
37+
38+
# vercel
39+
.vercel
40+
41+
# typescript
42+
next-env.d.ts
43+
/dist/
44+
/.wrangler/
45+
/outputs/
46+
/work/
47+
48+
# Python caches
49+
__pycache__/
50+
*.py[cod]
51+
.pytest_cache/
52+
53+
# Local media and generated analysis artifacts
54+
*.mp4
55+
*.mov
56+
*.mkv
57+
*.avi
58+
*.webm
59+
*.m4v
60+
analysis-*.json
61+
62+
# Editor and OS files
63+
.idea/
64+
.vscode/
65+
Thumbs.db

‎.openai/hosting.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"project_id": "appgprj_6a64a6754eac8191a25ecc173152c244",
3+
"d1": null,
4+
"r2": null
5+
}

‎AGENTS.md‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Repository guidance
2+
3+
## Primary product
4+
5+
The primary product is the local KPL video analyzer:
6+
7+
- backend and tracking: `local_app.py`
8+
- browser UI: `local-ui/`
9+
- Python dependencies: `requirements-local.txt`
10+
- Windows launcher: `start-local.bat`
11+
12+
The `app/` and `worker/` directories contain a separate optional vinext web prototype. Do not assume it performs local OpenCV video analysis.
13+
14+
## Required checks
15+
16+
For changes to the local analyzer:
17+
18+
```text
19+
python -m py_compile local_app.py
20+
node --check local-ui/app.js
21+
```
22+
23+
For changes under `app/`, `worker/`, build configuration, or package dependencies:
24+
25+
```text
26+
npm run build
27+
```
28+
29+
## Data safety
30+
31+
Never commit videos, files under `local-data/`, generated exports, virtual environments, tokens, or user-specific absolute paths. Test fixtures must be synthetic or redistributable.
32+
33+
## Semantics
34+
35+
- Coordinates are percentages with origin at the top-left.
36+
- `t` is game time; `videoT` is source video time.
37+
- Player IDs are only stable within one match.
38+
- Samples below 0.5 confidence are not shown or aggregated by default.
39+
- Region rules are documented in `docs/REGION_RULES.md`; update the docs whenever code semantics change.
40+
41+
## Contribution style
42+
43+
Prefer small, evidence-backed changes. Tracking modifications must report their effect on accuracy, identity swaps, source distribution, and runtime. Preserve explicit uncertainty instead of fabricating exact positions.

0 commit comments

Comments
 (0)