nx_vitpose_prep.nx
buildroot/runtime/nx_vitpose_prep.nx
about
nx_vitpose_prep.nx -- decode the fetched JPEG + preprocess into the ViTPose input tensor, written to a file the
forward reads. Reads the image path from data/mp_img_dest.txt: nx_jpeg_decode_rgb -> u8 RGB [h,w,3] -> i64 ->
nx_vitpose_preprocess(resize 256x192 + ImageNet normalize) -> [1,3,256,192] f32 -> models/vitpose_input.bin
(f32 as u32le). expect_exit: 0
dependencies 6 imports · 0 importers
imports: nx_syscalls.nxnx_f32.nxnx_f32_cvt.nxnx_f32_div.nxnx_jpeg_ascii.nxnx_vitpose_preprocess.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
| 11 | const K_MAGIC_4096: i64 = 4096 |
| 12 | const K_MAGIC_4194304: i64 = 4194304 |
functions
| 14 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 16 | func rdcfg(path: *u8, buf: *u8, cap: i64) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0{return 0-1} var n: i64=sys_read(fd,buf,cap-1); sys_close(fd); if n<0{return 0-1} var go: i64=1; while go==1{go=0; if n>0{ let c: i64=buf[n-1] as i64; if c==10{n=n-1;go=1} if c==13{n=n-1;go=1} if c==32{n=n-1;go=1} }} buf[n]=0 as u8; return n } |
| 17 | func mk(n: i64, d: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(n), nx_i32_to_f32(d)) } |
| 19 | func main() -> i64 |