code wiki / _hdl_build / nx_gsplat_photofit_gate.nx
nx_gsplat_photofit_gate.nx
buildroot/runtime/_hdl_build/nx_gsplat_photofit_gate.nx
about
nx_gsplat_photofit_gate.nx -- ★FIT THE SPLAT FACE TO THE PHOTO (the optimizer on the real goal). TARGET = the
reference photo mapped onto our geometry, rendered SHARP by the SDF projection (nx_sdfrender). The splat face
(Gaussians on the mesh) starts FLAT-SKIN-coloured (unlearned) and the differentiable-splatting optimizer fits
its colours to the photo target -> the splat LEARNS the face appearance (deconvolving the splat-overlap blur).
Same camera (yaw/camz/FOCAL 586) so SDF-projected + splat align in-frame.
T1 the optimizer LEARNS the photo: L1(splat, photo-target) drops hard from the flat-skin start
T2 the fitted splat matches the photo target markedly better than the naive flat start (measured improvement)
T3 PNG knowledge/nx_gsplat_photofit.png (photo-target | flat-start | fitted) + determinism
license_tier: ORIGINAL expect_exit: 0
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_jpeg_ascii.nxnx_sdfrender_mt.nxnx_faceanat.nxnx_meshgen.nxnx_gsplat.nxnx_png.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
| 38 | const P_UC: i64 = 256 |
| 39 | const P_VC: i64 = 329 |
| 40 | const P_SU: i64 = 333 |
| 41 | const P_SV: i64 = 350 |
| 42 | const P_VLO: i64 = 240 |
| 43 | const P_VHI: i64 = 440 |
| 44 | const YAW: i64 = 200 |
functions
| 18 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 19 | func pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 } |
| 20 | func l1(a: *i64, b: *i64, n: i64) -> i64 { var s: i64=0; var i: i64=0; while i<n { var dr: i64=(a[i]&255)-(b[i]&255); if dr<0{dr=0-dr} var dg: i64=((a[i]>>8)&255)-((b[i]>>8)&255); if dg<0{dg=0-dg} var db: i64=((a[i]>>16)&255)-((b[i]>>16)&255); if db<0{db=0-db} s=s+dr+dg+db; i=i+1 } return s } called by 1: main |
| 23 | func l1_masked(a: *i64, target: *i64, masksrc: *i64, n: i64) -> i64 called by 1: main |
| 46 | func main() -> i64 |