G-SHARP v0.2 Integration Proposal¶
- Status:
Implemented on branch
vnath_gsharp(undergsplat.contrib.dynamic); experimental, APIs may change- Source:
holohub/applications/surgical_scene_recon/(G-SHARP v0.2)- Destination:
gsplat/(branchvnath_gsharp)
Goals¶
Port all training-time algorithmic contributions of G-SHARP v0.2 natively into gsplat.
Keep the deformable / 4D Gaussian machinery behind a clearly experimental
gsplat/contrib/namespace.Ship test-first: every ported unit has positive + negative pytest cases.
Provide a runnable end-to-end tutorial on the EndoNeRF sample.
Non-goals¶
No Holoscan / HoloHub imports anywhere.
No Depth Anything V2 / MedSAM3 / VGGT code inside the
gsplat/package. These are external pretrained nets; the tutorial only references them as optional upstream preprocessing.No compression / rate-distortion work (not present in G-SHARP v0.2).
No camera-pose optimization (G-SHARP v0.2 doesn’t do it either).
Component map¶
Core (stable) additions:
Component |
New file |
G-SHARP source |
|---|---|---|
Binocular disparity L1 loss |
|
|
Pearson depth loss (mono) |
|
same |
Masked L1 / SSIM wrappers |
|
|
Occlusion-TV regularizer |
|
|
Torch mask dilation |
|
OpenCV dilation replaced by max-pool |
Invisible-mask builder |
|
|
Multi-frame depth unprojection |
|
|
KNN scale init |
|
|
Two-stage scheduler |
|
|
Experimental contrib additions (gsplat.contrib.dynamic):
Component |
New file |
G-SHARP source |
|---|---|---|
HexPlane field |
|
|
Deform MLP + per-Gaussian deformation table |
|
|
Plane / time smoothness regularizers |
|
|
DynamicStrategy |
|
|
Examples / docs:
Deliverable |
Path |
|---|---|
EndoNeRF/SCARED dataset loader |
|
Dynamic-scene trainer recipe |
|
Tutorial |
|
Contrib API docs |
|
Why this layout¶
The core library stays pure splatting math. Depth losses / occlusion-TV / multi-frame init / two-stage schedule are generic and low-risk, so they live alongside existing
losses.py,rendering.py,strategy/.4D / deformable pieces add new public surfaces (
HexPlane,DeformNet,DynamicStrategy) that are still research-grade →gsplat/contrib/dynamic/signals “ships with the wheel, API may change”. Pattern follows the well-knowntorchvision.prototypeconvention.EndoNeRF/SCARED loader is domain-specific dataset glue → belongs with
colmap.py/ncore.pyunderexamples/datasets/, not in the library.DA2 / MedSAM3 / VGGT do not enter the tree; the tutorial explains “get
poses_bounds.npy,masks/,depth/some way” and points at the (unported) holohub folder for reference.
Test plan¶
Every new module gets a tests/test_*.py with both positive and negative
cases. Tests follow the flat layout and pytest conventions already in
gsplat/tests/ (conftest.py, seed 42, CUDA-aware).
See the component × test-case matrix in
planning/gsharp_gsplat_plan.md. (A shareable HTML preview can be
rendered from that markdown locally; it is intentionally not tracked in
the repo.)
Risks¶
Deformation + ``rasterization()`` coupling.
gsplat.rasterizationhas no time axis. Solution:DynamicStrategyapplies the deform-net to(means, quats, opacities)beforerasterization(...)is called (same pattern as G-SHARP’srasterize_splats).CUDA-only tests. HexPlane/DeformNet tests run on CPU for determinism; GPU smoke tests are marked CUDA-only.
EndoNeRF sample license. Documented in the tutorial, not redistributed in-tree.
sklearn optional dep. Pure-torch fallback for KNN init keeps the required-dep list unchanged.