Stable-X commited on
Commit
acc5f47
1 Parent(s): 9dc5081

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -168,8 +168,11 @@ def reconstruct(video_path, conf_thresh, kf_every, as_pointcloud=False):
168
  rot[:3, :3] = Rotation.from_euler('y', np.deg2rad(180)).as_matrix()
169
  scene.apply_transform(np.linalg.inv(OPENGL @ rot))
170
 
171
- # Save the scene as GLB
172
- output_path = tempfile.mktemp(suffix='.glb')
 
 
 
173
  scene.export(output_path)
174
 
175
  # Clean up temporary directory
@@ -182,7 +185,7 @@ iface = gr.Interface(
182
  inputs=[
183
  gr.Video(label="Input Video"),
184
  gr.Slider(0, 1, value=1e-3, label="Confidence Threshold"),
185
- gr.Slider(1, 30, step=1, value=5, label="Keyframe Interval"),
186
  gr.Checkbox(label="As Pointcloud", value=False)
187
  ],
188
  outputs=[
 
168
  rot[:3, :3] = Rotation.from_euler('y', np.deg2rad(180)).as_matrix()
169
  scene.apply_transform(np.linalg.inv(OPENGL @ rot))
170
 
171
+ if as_pointcloud:
172
+ output_path = tempfile.mktemp(suffix='.ply')
173
+ else:
174
+ output_path = tempfile.mktemp(suffix='.obj')
175
+
176
  scene.export(output_path)
177
 
178
  # Clean up temporary directory
 
185
  inputs=[
186
  gr.Video(label="Input Video"),
187
  gr.Slider(0, 1, value=1e-3, label="Confidence Threshold"),
188
+ gr.Slider(1, 30, step=1, value=1, label="Keyframe Interval"),
189
  gr.Checkbox(label="As Pointcloud", value=False)
190
  ],
191
  outputs=[