mirror of
https://github.com/ruvnet/RuView
synced 2026-08-08 20:11:43 +00:00
fix: resolve all 10 confirmed code-review findings (7-angle review, 20/20 verified)
wiflow_std: min_feature_width (default 15) replaces the keypoints->stride coupling — for_keypoints(17) now provably builds the trained [2,2,2,2] graph and pools 15->17, matching the validated Python protocol (pinned by tests); param_count() total on invalid configs; random_mask returns Result and rejects non-finite/out-of-range ratios; trainer checkpoints switched to safetensors (.pt VarStore roundtrip broken on Windows torch 2.11). ieee80211bf: SBP proxy now re-triggers instances and relays reports via Action::RelaySbpReport -> SensingFrame::SbpReport (clients consume via their existing path); missed_instances reset on success = consecutive semantics; SessionTable gains a guarded SBP entry point + unknown-id drop counter; initiator-role sessions reject inbound setup/SBP requests (RejectedNotSupported) closing the idle hijack; StartSetup/StartSbp outside Idle return InvalidStateForCommand; SBP validation unified through evaluate_setup with a 1:1 SetupStatus->SbpStatus mapping. events.rs split out to honor the 500-line cap. calibration/cli: enrollment geometry now actually reaches trained banks — both production call sites attach .with_geometry; --geometry flag on train-room and POST /enroll/geometry + train-body geometry on calibrate-serve give production a recording surface; geometry-free banks log the ADR-152 §2.1.2 note. benchmarks: corruption masks committed as ground truth (unregenerable after in-place cleaning; verified bit-identical regeneration from the pristine copy) + generate_corruption_masks.py producer; _bench_common.py dedups the 5x-copied shim/evaluate/seed/remap (post-refactor PCK@20 re-verified equal to the last digit); remote scripts get the mmap patch; tiny_edge --calib validated multiple-of-64; onnx_bench --help no longer executes (and overwrote) the export — artifact restored byte-exact. Workspace: 2,963 tests passed, 0 failed; Python proof PASS. Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -17,41 +17,17 @@ import argparse
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
import torch
|
||||
|
||||
HERE = os.path.dirname(os.path.abspath(__file__))
|
||||
RESULTS = os.path.join(HERE, "results")
|
||||
sys.path.insert(0, HERE)
|
||||
|
||||
from _bench_common import RESULTS, evaluate # noqa: E402
|
||||
from quantize_bench import build_test_subset # noqa: E402 (sets up upstream imports)
|
||||
|
||||
sys.path.insert(0, os.path.join(HERE, "upstream"))
|
||||
from utils.metrics import calculate_mpjpe, calculate_pck # noqa: E402
|
||||
|
||||
|
||||
def evaluate_ort(sess, loader, label):
|
||||
inp = sess.get_inputs()[0].name
|
||||
totals = {0.2: 0.0, 0.5: 0.0}
|
||||
total_mpe, n = 0.0, 0
|
||||
t0 = time.time()
|
||||
for batch_idx, (bx, by) in enumerate(loader):
|
||||
out = torch.from_numpy(sess.run(None, {inp: bx.numpy()})[0])
|
||||
pck = calculate_pck(out, by, thresholds=[0.2, 0.5])
|
||||
mpe = calculate_mpjpe(out, by)
|
||||
bs = by.size(0)
|
||||
total_mpe += mpe * bs
|
||||
for t in totals:
|
||||
totals[t] += pck[t] * bs
|
||||
n += bs
|
||||
if batch_idx % 50 == 0:
|
||||
print(f" [{label}] batch {batch_idx}: n={n} "
|
||||
f"pck20={totals[0.2]/n:.4f} mpjpe={total_mpe/n:.4f} "
|
||||
f"({time.time()-t0:.0f}s)", flush=True)
|
||||
return {"samples": n, "pck@20": totals[0.2] / n, "pck@50": totals[0.5] / n,
|
||||
"mpjpe": total_mpe / n, "wall_seconds": time.time() - t0}
|
||||
"""ORT-session evaluation via the canonical _bench_common.evaluate loop."""
|
||||
return evaluate(sess, loader, label=label)
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user