Update app.py
Browse files
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 |
-
|
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 |
-
|
128 |
-
|
|
|
|
|
|
|
|
|
129 |
|
130 |
# Clean up
|
131 |
torch.cuda.empty_cache()
|
132 |
-
return
|
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
|