Spaces:
Running
on
L4
Running
on
L4
Commit
·
dff420a
1
Parent(s):
de752a5
Enhance app.py UI with new logo and updated title; add demo assets to .gitattributes. Remove unused main function from navigation.py and streamline .gitignore.
Browse files- .gitattributes +2 -0
- .gitignore +0 -1
- app.py +6 -5
- assets/title_logo.png +3 -0
- navigation.py +0 -48
.gitattributes
CHANGED
@@ -42,3 +42,5 @@ test_samples/living_room_2.jpeg filter=lfs diff=lfs merge=lfs -text
|
|
42 |
test_samples/living_room.jpg filter=lfs diff=lfs merge=lfs -text
|
43 |
test_samples/oxford.jpg filter=lfs diff=lfs merge=lfs -text
|
44 |
test_samples/arc_de_tromphe.jpeg filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
42 |
test_samples/living_room.jpg filter=lfs diff=lfs merge=lfs -text
|
43 |
test_samples/oxford.jpg filter=lfs diff=lfs merge=lfs -text
|
44 |
test_samples/arc_de_tromphe.jpeg filter=lfs diff=lfs merge=lfs -text
|
45 |
+
assets/demo_teaser.gif filter=lfs diff=lfs merge=lfs -text
|
46 |
+
assets/title_logo.png filter=lfs diff=lfs merge=lfs -text
|
.gitignore
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
assets/*
|
2 |
pycache/*
|
3 |
__pycache__/*
|
4 |
.DS_Store
|
|
|
|
|
1 |
pycache/*
|
2 |
__pycache__/*
|
3 |
.DS_Store
|
app.py
CHANGED
@@ -807,9 +807,10 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="blue")) as demo:
|
|
807 |
demo_idx = gr.State(value=3)
|
808 |
|
809 |
with gr.Sidebar():
|
810 |
-
gr.
|
|
|
811 |
gr.Markdown(
|
812 |
-
"###
|
813 |
)
|
814 |
gr.Markdown("---")
|
815 |
gr.Markdown("#### Links ↓")
|
@@ -868,8 +869,8 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue="blue")) as demo:
|
|
868 |
|
869 |
|
870 |
if __name__ == "__main__":
|
871 |
-
demo.launch(debug=
|
872 |
share=True,
|
873 |
-
max_threads=1,
|
874 |
-
show_error=
|
875 |
)
|
|
|
807 |
demo_idx = gr.State(value=3)
|
808 |
|
809 |
with gr.Sidebar():
|
810 |
+
gr.Image("assets/title_logo.png", width=60, height=60, show_label=False, show_download_button=False, container=False, interactive=False, show_fullscreen_button=False)
|
811 |
+
gr.Markdown("# Consistent Interactive Video Scene Generation with Surfel-Indexed View Memory", elem_id="page-title")
|
812 |
gr.Markdown(
|
813 |
+
"### Interactive Demo for [_VMem_](https://arxiv.org/abs/2502.06764) that enables interactive consistent video scene generation."
|
814 |
)
|
815 |
gr.Markdown("---")
|
816 |
gr.Markdown("#### Links ↓")
|
|
|
869 |
|
870 |
|
871 |
if __name__ == "__main__":
|
872 |
+
demo.launch(debug=False,
|
873 |
share=True,
|
874 |
+
max_threads=1,
|
875 |
+
show_error=False,
|
876 |
)
|
assets/title_logo.png
ADDED
![]() |
Git LFS Details
|
navigation.py
CHANGED
@@ -428,51 +428,3 @@ class Navigator:
|
|
428 |
|
429 |
|
430 |
|
431 |
-
|
432 |
-
def main():
|
433 |
-
parser = argparse.ArgumentParser(description="Interactive navigation in VMem")
|
434 |
-
parser.add_argument("--config", type=str, default="configs/inference/inference.yaml", help="Path to config file")
|
435 |
-
parser.add_argument("--step_size", type=float, default=0.1, help="Forward step size")
|
436 |
-
parser.add_argument("--interpolation_frames", type=int, default=4, help="Number of frames for each movement")
|
437 |
-
parser.add_argument("--commands", type=str, default="a,a,a,a,a,d,d,d,d,d,d,w,w,w,w,a,a,a,a,d,d,d,d,s,s,s,s", help="Comma-separated commands to execute (w,a,s,d,c,q) where c is circulate")
|
438 |
-
# parser.add_argument("--commands", type=str, default="d,d,d,d,w,w,w,d,d,d,d,d,a,a,a,a,a,s,s", help="Comma-separated commands to execute (w,a,s,d,c,q) where c is circulate")
|
439 |
-
parser.add_argument("--output_dir", type=str, default="./visualization/navigation_frames", help="Directory to save output frames")
|
440 |
-
parser.add_argument("--save_poses", type=str, default="./visualization/transforms.json", help="Path to save camera poses in NeRF format")
|
441 |
-
args = parser.parse_args()
|
442 |
-
|
443 |
-
# Load configuration
|
444 |
-
config = OmegaConf.load(args.config)
|
445 |
-
|
446 |
-
# Initialize the pipeline
|
447 |
-
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
448 |
-
pipeline = VMemPipeline(config, device=device)
|
449 |
-
|
450 |
-
# Create the navigator
|
451 |
-
navigator = Navigator(pipeline, step_size=args.step_size, num_interpolation_frames=args.interpolation_frames)
|
452 |
-
|
453 |
-
# Load episode data
|
454 |
-
frame_path = "test_samples/arc_de_tromphe.jpeg"
|
455 |
-
image, _ = load_img_and_K(frame_path, None, K=None, device=device)
|
456 |
-
image, _ = transform_img_and_K(image, (config.model.height, config.model.width), mode="crop", K=None)
|
457 |
-
ori_K = np.array(get_default_intrinsics()[0])
|
458 |
-
initial_pose = np.eye(4)
|
459 |
-
|
460 |
-
# Initialize the navigator with the first frame using pipeline's initialize method
|
461 |
-
initial_frame = navigator.initialize(image, initial_pose, ori_K)
|
462 |
-
|
463 |
-
# Create output directory if needed
|
464 |
-
if args.output_dir:
|
465 |
-
os.makedirs(args.output_dir, exist_ok=True)
|
466 |
-
initial_frame.save(os.path.join(args.output_dir, "initial.png"))
|
467 |
-
|
468 |
-
# If commands are provided, execute them in sequence
|
469 |
-
commands = args.commands.split(',')
|
470 |
-
all_frames_lists = navigator.navigate(commands)
|
471 |
-
|
472 |
-
|
473 |
-
# Save camera poses
|
474 |
-
if args.save_poses:
|
475 |
-
navigator.save_camera_poses(args.save_poses)
|
476 |
-
|
477 |
-
if __name__ == "__main__":
|
478 |
-
main()
|
|
|
428 |
|
429 |
|
430 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|