Update app.py
Browse files
app.py
CHANGED
@@ -96,7 +96,6 @@ def get_reconstructed_scene(outdir, model, device):
|
|
96 |
|
97 |
assert c == 3, "Images must have 3 channels"
|
98 |
|
99 |
-
|
100 |
gaussians, pred_context_pose = model.inference((images + 1) * 0.5)
|
101 |
|
102 |
pred_all_extrinsic = pred_context_pose["extrinsic"]
|
@@ -111,10 +110,8 @@ def get_reconstructed_scene(outdir, model, device):
|
|
111 |
outdir,
|
112 |
model.decoder,
|
113 |
)
|
114 |
-
|
115 |
plyfile = os.path.join(outdir, "gaussians.ply")
|
116 |
-
|
117 |
-
|
118 |
export_ply(
|
119 |
gaussians.means[0],
|
120 |
gaussians.scales[0],
|
@@ -124,16 +121,9 @@ def get_reconstructed_scene(outdir, model, device):
|
|
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
|
137 |
|
138 |
|
139 |
# 2) Handle uploaded video/images --> produce target_dir + images
|
|
|
96 |
|
97 |
assert c == 3, "Images must have 3 channels"
|
98 |
|
|
|
99 |
gaussians, pred_context_pose = model.inference((images + 1) * 0.5)
|
100 |
|
101 |
pred_all_extrinsic = pred_context_pose["extrinsic"]
|
|
|
110 |
outdir,
|
111 |
model.decoder,
|
112 |
)
|
|
|
113 |
plyfile = os.path.join(outdir, "gaussians.ply")
|
114 |
+
|
|
|
115 |
export_ply(
|
116 |
gaussians.means[0],
|
117 |
gaussians.scales[0],
|
|
|
121 |
Path(plyfile),
|
122 |
save_sh_dc_only=True,
|
123 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
# Clean up
|
125 |
torch.cuda.empty_cache()
|
126 |
+
return plyfile, video, depth_colored
|
127 |
|
128 |
|
129 |
# 2) Handle uploaded video/images --> produce target_dir + images
|