nx_pose_preprocess.nx
buildroot/runtime/nx_pose_preprocess.nx
about
nx_pose_preprocess.nx -- ViTPose top-down preprocessing: real image + GT bbox -> vitpose_input.bin.
Pipeline (faithful to mmpose TopDownGetBboxCenterScale + TopDownAffine):
decode baseline/progressive JPEG (nx_jpeg_decode_rgb) -> packed RGB
-> aspect-fix bbox to 192:256 (3:4), pad x1.25 (mmpose default) -> crop box [x0,y0,cw,ch]
-> bilinear resize crop -> 192x256 -> ImageNet normalize ((v/255-mean)/std, RGB)
-> write CHW f32 LE (3*256*192*4 B) exactly as nx_vitpose_forward reads it.
Emits data/mp_crop.txt "x0 y0 cw ch" so postprocess maps heatmap(48x64)->image coords with the SAME box.
Config: data/mp_img_dest.txt (jpg path), data/mp_bbox.txt ("x y w h"). 100% sovereign decode+math.
verdict: NOT_YET_EVALUATED lineage_id: nx_pose_preprocess_v1
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_jpeg_ascii.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 16 | const K_MAGIC_4096: i64 = 4096 |
| 17 | const K_MAGIC_1024: i64 = 1024 |
functions
| 19 | func pp_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return n } |
| 24 | func pp_wn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 25 | func pp_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 31 | func pp_cfg(path: *u8, out: *u8, cap: i64) -> i64 |
| 40 | func pp_ints(s: *u8, v: *i64) -> i64 called by 1: main |
| 53 | func pp_f2i(x: i64) -> i64 |
| 63 | func main() -> i64 |