geometry-and-evaluation
Use for CPU-safe SECOND box geometry, coordinate conversion, encoding and target assignment, IoU/NMS decisions, KITTI or NuScenes evaluation, result conversion, and tiny-fixture validation.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- geometry-and-evaluation
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Use for CPU-safe SECOND box geometry, coordinate conversion, encoding and target assignment, IoU/NMS decisions, KITTI or NuScenes evaluation, result conversion, and tiny-fixture validation.
- disable-model-invocation
- true
02 资源文件 5
- 参考文档references/api-reference.md8.0 KB
- 参考文档references/coordinate-systems.md4.5 KB
- 参考文档references/evaluation.md5.6 KB
- 参考文档references/troubleshooting.md6.0 KB
- 脚本scripts/geometry_smoke.py6.9 KB
03 SKILL.md 正文
Geometry and evaluation
Use this route when a task mentions lidar or camera boxes, corners, yaw, encode/decode, anchors, target assignment, IoU, NMS, KITTI labels/AP, NuScenes result JSON, or coordinate transforms. This is a static/CPU-safe operating route. It does not prove detector execution.
Operating boundary
-
Prefer NumPy-only geometry and fixture checks. Read api-reference.md for signatures, shapes, and source-faithful dimension order.
-
Read coordinate-systems.md before converting KITTI camera boxes, internal lidar boxes, or NuScenes boxes.
-
Read evaluation.md before building annotations, interpreting AP, or writing NuScenes submissions.
-
Run the bundled helper before changing box conventions:
python skills/disco/second-pytorch/sub-skills/geometry-and-evaluation/scripts/geometry_smoke.py --help python skills/disco/second-pytorch/sub-skills/geometry-and-evaluation/scripts/geometry_smoke.pyExpected output contains four
[PASS]checks andgeometry smoke: PASS; the helper imports only NumPy and never imports the detector, spconv, Numba CUDA, or Torch.
Safe workflow
- Normalize every box array to an explicit shape and convention. Internal lidar
boxes are normally
[N, 7] = [x, y, z, w, l, h, rz]; preserve any velocity or custom values only after documenting their trailing columns. - Check dimensions are positive, row counts agree, calibration matrices are homogeneous-compatible, and labels/scores have the same first dimension.
- For corners, use
center_to_corner_box3dwith lidaraxis=2and the correct origin; usecenter_to_corner_box2dfor[x, y, w, l, rz]. Never silently swapw,l,hwith KITTIl,h,w. - For regression, pair each target with its anchor (
[N,7]), select linear dimensions or log dimensions consistently, and compare decoded centers, dimensions, and angle modulo the selected period. Vector-angle coding has code size 8 rather than 7. - For assignment, inspect feature-map order
[D,H,W], class-specific anchor ranges, thresholds, and label semantics (1+positive,0negative,-1ignore). Use a tiny overlap matrix before sampling positives. - Treat NMS as a separate backend decision. The axis-aligned
nms_jitalgorithm is CPU NumPy/Numba math, but its historical module may import legacy spconv transitively; rotated CPU NMS depends on the same helpers. GPU NMS and rotated IoU use legacy Numba CUDA/spconv interfaces and are not verified. - For KITTI, validate annotation keys, class spelling, dimensions, camera/lidar
convention, and
z_axis/z_centerbefore calling evaluation. For NuScenes, validate sample tokens, class mapping, quaternion andwlhorder, range filtering, and required devkit availability before invoking the evaluator.
API and failure routing
- Use api-reference.md for box math, anchors, target assignment, similarity, point-in-box, and NMS signatures.
- Use coordinate-systems.md for axes, origins, angle periods, calibration direction, and visualization conventions.
- Use evaluation.md for KITTI schemas, metric output shapes, NuScenes JSON fields, and minimal perfect-match fixtures.
- Use troubleshooting.md when imports, optional dependencies, malformed arrays/configs, CLI/API calls, or evaluator output fail.
Verification status and historical caveats
This checkout has no setup metadata. The model path uses legacy spconv and Numba
APIs; modern spconv 2.x is not proven compatible. The inspection environment had
NumPy, Numba, Torch, spconv, Fire, tensorboardX, nuscenes-devkit, and related
packages, and an A100 CUDA smoke was available, but detector execution was not
accepted as verified. In particular, the installed spconv did not expose the
legacy non_max_suppression/VoxelGeneratorV2 interfaces. Do not claim that GPU
NMS kernels, modern spconv NMS, or the full detector runtime executed successfully.
For new detector work, treat this route as historical guidance and prefer a
maintained SECOND implementation rather than extending the deprecated runtime.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).