code wiki / (root) / nx_coco_eval.nx

nx_coco_eval.nx

buildroot/runtime/nx_coco_eval.nx

11437 B260 linesdepth 6pulls 10 transitivereach 0 importersview sourcekind tooltopic coco
docsdependenciesstructsconstsfunctions

about

nx_coco_eval.nx -- REAL industry COCO keypoint scorer (GT-bbox variant). Reads the sovereign-fetched COCO GT JSONL (whyen-wang/coco_keypoints -> keypoints_validation.jsonl, format per line: {"image":"..jpg","bboxes":[[x,y,w,h],..],"keypoints":[[[x,y,v]x17],..]}) and a predictions JSONL in the SAME shape, and computes per-person OKS (official COCO sigmas, s^2 = bbox area) + COCO AP@[.5:.95] via the gated nx_coco_oks / nx_coco_ap. This is the EXTERNAL grader that ends the self- validation: GT is COCO's real annotations, not our own model's output. GT-bbox eval: predictions are produced by running the pose net on each GT bbox, so pred person i <-> GT person i (no detector, no FPs) => AP@t = fraction of persons with OKS>=t (what nx_coco_ap computes). This is the standard, DISCLOSED "pose accuracy with GT bbox" number (not detector AP). Area = bbox w*h (this dataset carries bbox, not mask area -- documented approximation; official COCO uses segmentation area). Modes (build/run launcher forwards no argv -> config files, cwd=nxc2): data/mp_eval_gt.txt -- GT JSONL path (required) data/mp_eval_pred.txt -- predictions JSONL path (optional). Present+nonempty => REAL eval (pair by image name). Absent/empty => SELF-TEST on real GT line 1 (identity=1000 + shift). nx_safety_envelope: intended_use: offline scoring of pose predictions vs real COCO GT sil_target: SIL1 verdict: NOT_YET_EVALUATED genealogy_id: cocodataset/cocoeval(OKS) lineage_id: nx_coco_eval_v1

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_coco_oks.nx nx_coco_ap.nx nx_coco_eval.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_coco_oks.nxnx_coco_ap.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap ce_cfg sys_openat_rd sys_mmap ↻ sys_read sys_close ce_puts sys_write ce_read_all sys_openat_rd ↻ sys_read ↻ sys_close ↻ ce_putn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap sys_exit ce_parse ce_find_key sys_mmap ↻ ce_pull ce_person_oks sys_mmap ↻ nx_i32_to_f32 coco_oks nx_i32_to_f32 ↻ nx_f32_div nx_f32_classify nx_f32_exp_field nx_f32_mant_field nx_f32_sign nx_f32_mant_field ↻ nx_f32_exp_field ↻ oks_sigma1000 sys_mmap ↻ nx_f32_mul

structs

none

consts

32const K_MAGIC_4096: i64 = 4096
33const K_MAGIC_1024: i64 = 1024
34const K_MAGIC_8192: i64 = 8192

functions

36func ce_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return n }
called by 1: main calls 1: sys_write
41func ce_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
43func ce_read_all(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
56func ce_cfg(path: *u8, out: *u8, cap: i64) -> i64
77func ce_find_key(buf: *u8, n: i64, from: i64, key: *u8, klen: i64) -> i64
called by 1: ce_parse
91func ce_pull(buf: *u8, n: i64, p0: i64, out: *i64, cap: i64, endbox: *i64) -> i64
called by 1: ce_parse
131func ce_parse(buf: *u8, lstart: i64, lend: i64, bbox: *i64, bbcap: i64, kp: *i64, kpcap: i64, kpn_box: *i64) -> i64
called by 1: main calls 3: ce_find_keysys_mmapce_pull
145func ce_person_oks(bbox: *i64, gkp: *i64, pkp: *i64, j: i64) -> i64
called by 1: main calls 3: sys_mmapnx_i32_to_f32coco_oks
169func main() -> i64