import sys sys.path.append('wild-gaussian-splatting/mast3r/') sys.path.append('demo/') import os import gradio as gr import torch from mast3r.demo import get_args_parser from mast3r_demo import mast3r_demo_tab from gs_demo import gs_demo_tab from demo_globals import CACHE_PATH import shutil def start_session(req: gr.Request): user_dir = os.path.join(CACHE_PATH, str(req.session_hash)) os.makedirs(user_dir, exist_ok=True) def end_session(req: gr.Request): user_dir = os.path.join(CACHE_PATH, str(req.session_hash)) shutil.rmtree(user_dir) if __name__ == '__main__': with gr.Blocks() as demo: gr.HTML('''

MASt3R and 3DGS Pipeline Demo

This pipeline is designed for 3D reconstruction using MASt3R and 3DGS.

The process is divided into two stages:

  1. MASt3R is used to obtain the initial point cloud and camera parameters.
  2. 3DGS is then trained on the results from MASt3R to refine the 3D scene representation.

Note: After a page reload, any generated MASt3R datasets in the 3DGS tab will be deleted.

For a full version of this pipeline, please visit the repository at:

nerlfield/wild-gaussian-splatting
''') with gr.Tabs(): with gr.Tab("MASt3R"): mast3r_demo_tab() with gr.Tab("3DGS"): gs_demo_tab() demo.load(start_session) demo.unload(end_session) demo.launch(show_error=True, share=None, server_name=None, server_port=None)