File size: 735 Bytes
1308f6d
 
 
 
 
 
 
 
 
bd0195a
1308f6d
83731ec
1308f6d
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import sys
sys.path.append('wild-gaussian-splatting/mast3r/')

import os
import tempfile
import torch
from mast3r.utils.misc import hash_md5
from mast3r.model import AsymmetricMASt3R

DATASET_DIR = "colmap_data"
weights_path = "naver/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric"
# weights_path = '/app/wild-gaussian-splatting/mast3r/checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth'
tmpdirname = tempfile.TemporaryDirectory(suffix='demo')
chkpt_tag = hash_md5(weights_path)
CACHE_PATH = os.path.join(tmpdirname.name, chkpt_tag)
os.makedirs(CACHE_PATH, exist_ok=True)

DEVICE = device = 'cuda' if torch.cuda.is_available() else 'cpu'
MODEL = AsymmetricMASt3R.from_pretrained(weights_path).to(DEVICE)
SILENT = False