mast3r-3dgs / app.py
ostapagon's picture
Lower tf memory footprint
5f75751
raw
history blame
1.5 kB
import sys
sys.path.append('wild-gaussian-splatting/mast3r/')
sys.path.append('demo/')
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
torch.backends.cuda.matmul.allow_tf32 = True
if __name__ == '__main__':
# parser = get_args_parser()
# args = parser.parse_args()
# if args.server_name is not None:
# server_name = args.server_name
# else:
# server_name = '0.0.0.0'# if args.local_network else '127.0.0.1'
# weights_path = '/app/wild-gaussian-splatting/mast3r/checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth'
# weights_path = "naver/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric"#args.weights if args.weights is not None else + MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric
# device = device = 'cuda' if torch.cuda.is_available() else 'cpu'
# chkpt_tag = hash_md5(weights_path)
with gr.Blocks() as demo:
with gr.Tabs():
with gr.Tab("MASt3R Demo"):
mast3r_demo_tab()
with gr.Tab("Gaussian Splatting Demo"):
gs_demo_tab()
demo.launch(show_error=True, share=None, server_name=None, server_port=None)
# demo.launch(show_error=True, share=None, server_name='0.0.0.0', server_port=5555)
# python3 demo.py --weights "/app/mast3r/checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth" --device "cuda" --server_port 3334 --local_network "$@"