code wiki / (root) / nx_vitpose_prep.nx

nx_vitpose_prep.nx

buildroot/runtime/nx_vitpose_prep.nx

3764 B59 linesdepth 9pulls 26 transitivereach 0 importersview sourcekind tooltopic vitpose
docsdependenciesstructsconstsfunctions

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

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

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

main sys_mmap rdcfg sys_openat_rd sys_read sys_close w sys_write sys_exit sys_openat_rd ↻ sys_read ↻ sys_close ↻ wn w ↻ sys_mmap ↻ sys_write ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ prog_be16 ↻ nx_jpeg_dqt_parse nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_sos_parse prog_next_marker prog_scan sys_mmap ↻ nx_jpeg_huff_decode_symbol

structs

none

consts

11const K_MAGIC_4096: i64 = 4096
12const K_MAGIC_4194304: i64 = 4194304

functions

14func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: wnmain calls 1: sys_write
15func 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 }
called by 1: main calls 3: wsys_mmapsys_write
16func 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 }
called by 1: main calls 3: sys_openat_rdsys_readsys_close
17func mk(n: i64, d: i64) -> i64 { return nx_f32_div(nx_i32_to_f32(n), nx_i32_to_f32(d)) }
called by 1: main calls 2: nx_f32_divnx_i32_to_f32
19func main() -> i64