code wiki / (root) / nx_vitpose_preprocess.nx

nx_vitpose_preprocess.nx

buildroot/runtime/nx_vitpose_preprocess.nx

2823 B60 linesdepth 4pulls 6 transitivereach 2 importersview sourcekind librarytopic vitpose
docsdependenciesstructsconstsfunctions

about

nx_vitpose_preprocess.nx -- image -> ViTPose input tensor: bilinear-resize an RGB image [sh,sw,3] (u8 0-255, interleaved) to dh x dw and ImageNet-normalize into out [1,3,dh,dw] f32 (NCHW): out = (pix/255 - mean_c)/std_c. The resize uses arbitrary-ratio bilinear via INTEGER coordinate math (src coord sy=(oy+0.5)*sh/dh-0.5 = rational with denom 2*dh -> exact int floor + weights, align_corners=False, PyTorch-matching). Reusable for ANY real-image inference (semantic validation of the ViTPose port + running it as a teacher for build-2). license_tier: ORIGINAL

dependencies 4 imports · 2 importers

nx_syscalls.nx nx_f32.nx nx_f32_cvt.nx nx_f32_div.nx nx_vitpose_preprocess.nx nx_vitpose_prep.nx nx_vitpose_preprocess_gate.nx

imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nx

imported by: nx_vitpose_prep.nxnx_vitpose_preprocess_gate.nx

structs

none

consts

none

functions

12func vitpose_resize_normalize(rgb: *i64, sh: i64, sw: i64, dh: i64, dw: i64, mean: *i64, std: *i64, out: *i64) -> i64