alexnasa commited on
Commit
2f9e25d
·
verified ·
1 Parent(s): 898dd6d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -113,7 +113,7 @@ def get_reconstructed_scene(outdir, model, device):
113
  )
114
 
115
  plyfile = os.path.join(outdir, "gaussians.ply")
116
- splatfile = os.path.join(outdir, "gaussians.splat")
117
 
118
  export_ply(
119
  gaussians.means[0],
@@ -124,12 +124,16 @@ def get_reconstructed_scene(outdir, model, device):
124
  Path(plyfile),
125
  save_sh_dc_only=True,
126
  )
127
- splat_data = process_ply_to_splat(plyfile)
128
- save_splat_file(splat_data, splatfile)
 
 
 
 
129
 
130
  # Clean up
131
  torch.cuda.empty_cache()
132
- return splatfile, video, depth_colored
133
 
134
 
135
  # 2) Handle uploaded video/images --> produce target_dir + images
 
113
  )
114
 
115
  plyfile = os.path.join(outdir, "gaussians.ply")
116
+ glbfile = os.path.join(outdir, "gaussians.glb")
117
 
118
  export_ply(
119
  gaussians.means[0],
 
124
  Path(plyfile),
125
  save_sh_dc_only=True,
126
  )
127
+ import trimesh
128
+
129
+ # Load your Gaussian-splat PLY (positions + any per-point attrs)
130
+ mesh = trimesh.load(plyfile)
131
+ # Export as .glb
132
+ mesh.export(glbfile)
133
 
134
  # Clean up
135
  torch.cuda.empty_cache()
136
+ return glbfile, video, depth_colored
137
 
138
 
139
  # 2) Handle uploaded video/images --> produce target_dir + images