Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -148,17 +148,19 @@ def update_gallery_on_upload(input_video, session_id):
|
|
| 148 |
return None, target_dir, image_paths
|
| 149 |
|
| 150 |
@spaces.GPU()
|
| 151 |
-
def
|
| 152 |
|
| 153 |
if session_id is None:
|
| 154 |
session_id = uuid.uuid4().hex
|
| 155 |
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
|
|
|
|
|
|
| 159 |
|
| 160 |
@spaces.GPU()
|
| 161 |
-
def
|
| 162 |
|
| 163 |
if session_id is None:
|
| 164 |
session_id = uuid.uuid4().hex
|
|
@@ -334,13 +336,13 @@ if __name__ == "__main__":
|
|
| 334 |
depth_video,
|
| 335 |
image_gallery
|
| 336 |
],
|
| 337 |
-
fn=
|
| 338 |
cache_examples=True,
|
| 339 |
)
|
| 340 |
|
| 341 |
|
| 342 |
submit_btn.click(
|
| 343 |
-
fn=
|
| 344 |
inputs=[target_dir_output, session_state],
|
| 345 |
outputs=[reconstruction_output, rgb_video, depth_video])
|
| 346 |
|
|
|
|
| 148 |
return None, target_dir, image_paths
|
| 149 |
|
| 150 |
@spaces.GPU()
|
| 151 |
+
def generate_splats_from_video(video_path, session_id=None):
|
| 152 |
|
| 153 |
if session_id is None:
|
| 154 |
session_id = uuid.uuid4().hex
|
| 155 |
|
| 156 |
+
# unpack the 3 outputs from the helper
|
| 157 |
+
plyfile, rgb_vid, depth_vid = generate_splats_from_images(images_folder, session_id)
|
| 158 |
+
|
| 159 |
+
# return all four in order
|
| 160 |
+
return plyfile, rgb_vid, depth_vid, image_paths
|
| 161 |
|
| 162 |
@spaces.GPU()
|
| 163 |
+
def generate_splats_from_images(images_folder, session_id=None):
|
| 164 |
|
| 165 |
if session_id is None:
|
| 166 |
session_id = uuid.uuid4().hex
|
|
|
|
| 336 |
depth_video,
|
| 337 |
image_gallery
|
| 338 |
],
|
| 339 |
+
fn=generate_splats_from_video,
|
| 340 |
cache_examples=True,
|
| 341 |
)
|
| 342 |
|
| 343 |
|
| 344 |
submit_btn.click(
|
| 345 |
+
fn=generate_splats_from_images,
|
| 346 |
inputs=[target_dir_output, session_state],
|
| 347 |
outputs=[reconstruction_output, rgb_video, depth_video])
|
| 348 |
|