Self-contained dynamic digital-twin prototype for 3D Gaussian Splatting. Provides stable identity embeddings (Submanifold Field VAE) and robust geometry (stochastic-solids median depth), all implemented inside this repo.
- Python >= 3.10 with a working PyTorch build (CUDA 12.1 if GPU; CPU works for tests).
- Core deps: torch, numpy, matplotlib, imageio or pillow, plyfile.
- Optional deps (auto-used when present): geomloss, faiss-cpu, open3d, rich, pytest.
environment.ymlis reference-only. Do not create a new env; justconda activate <your_env>.
From the repo root (parent of geoembed_twin/):
PYTHONPATH=. python -m geoembed_twin doctorPrints Python/Torch build info, CUDA availability, and missing core/optional deps. Exits nonzero if a core dep is missing.
geoembed_twin/requirements-optional.txt
geoembed_twin/scripts/install_optional_deps.sh
Safe to run repeatedly:
PYTHONPATH=. geoembed_twin/scripts/install_optional_deps.shcd /home/jing/Desktop/GS_2026 # repo root
PYTHONPATH=. python -m geoembed_twin selftest --quick # invariance + depth + smoke demo
PYTHONPATH=. python -m geoembed_twin demo --fast # full demo, deterministic seed
# helper wrapper: geoembed_twin/scripts/run_demo.shOutputs (in geoembed_twin/outputs/):
before_labeled.ply,after_labeled.plychange_summary.json- Depth PNGs:
depth_before/*,depth_after/*,depth_residual/* embeddings_before.npz,embeddings_after.npz
python -m geoembed_twin doctor [--json]python -m geoembed_twin selftest [--quick] [--skip-demo]python -m geoembed_twin demo [--fast] [--filter-floaters]python -m geoembed_twin sfvae-train [--fast]python -m geoembed_twin sfvae-embed --input <ply> [--ckpt outputs/checkpoints/sfvae_fallback.pt]python -m geoembed_twin render-depth --input <ply> --outdir <dir>
- Sample ellipsoid level-set points: (x_k = \mu + \Sigma^{1/2} u_k) with deterministic spherical grid (u_k).
- Color via real SH: (c_k = f_{SH}(u_k)); broadcast opacity.
- PointNet encoder → (\mu, \log\sigma^2); reparameterized latent (z); decoder reconstructs coords/colors on canonical sphere grid.
- Loss: Sinkhorn OT on ([x, \lambda c]) (geomloss) or Chamfer fallback + (\beta)-KL. Latents stay invariant to quaternion sign and scale ambiguities.
- Density: (G(x)=\alpha e^{-(x-\mu)^T\Sigma^{-1}(x-\mu)}); vacancy (v(x)=\sqrt{1-G(x)}).
- Per-Gaussian transmittance along ray (x(t)=o+\omega t): (T_i(t)=v_i(t)) for (t\le t_); (T_i(t)=v_i(t_)^2 / v_i(t)) for (t>t_*).
- Global (T(t)=\prod_i T_i(t)); median depth via log-space binary search on ([t_{near}, t_{far}]) using top-K nearest Gaussians per ray.
- Matching: cosine distance in latent space + spatial gate; mutual-NN pairs → added / removed / moved.
- Geometry cue: |depth_before − depth_after| residuals → backproject to mark geometry-changed Gaussians.
- Floater filter (optional): Gaussians consistently in front of median depth across views are suppressed.
- Build synthetic scene (cube + sphere surfaces + floaters).
- Apply changes: remove cluster A, translate cluster B, add cluster C.
- Train/reuse fallback SF-VAE; embed before/after scenes.
- Match embeddings → change labels.
- Render stochastic median depth for both states; compute residual heatmaps.
- Backproject residuals, fuse with embedding labels; optionally filter floaters.
- Export PLYs, PNGs, NPZs to
outputs/.
PYTHONPATH=. python -m geoembed_twin selftest --quickpytest geoembed_twin/tests -q(optional; same checks used by selftest)
- Missing core dep? Run
python -m geoembed_twin doctorfor install hints. - Checkpoint missing? Demo/selftest auto-trains to
outputs/checkpoints/sfvae_fallback.pt. - Depth looks empty: increase far plane or reduce
--topkonrender-depth/demo.
- Generated artifacts live in
outputs/(gitignored). - All functionality is implemented inside this repo; no external code is required.