try decorator
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@
|
|
4 |
# --------------------------------------------------------
|
5 |
# masst3r demo
|
6 |
# --------------------------------------------------------
|
|
|
7 |
import os
|
8 |
import sys
|
9 |
import os.path as path
|
@@ -14,6 +15,10 @@ HERE_PATH = path.normpath(path.dirname(__file__)) # noqa
|
|
14 |
MASt3R_REPO_PATH = path.normpath(path.join(HERE_PATH, './mast3r')) # noqa
|
15 |
sys.path.insert(0, MASt3R_REPO_PATH) # noqa
|
16 |
|
|
|
|
|
|
|
|
|
17 |
from mast3r.demo import main_demo
|
18 |
from mast3r.model import AsymmetricMASt3R
|
19 |
from mast3r.utils.misc import hash_md5
|
@@ -26,7 +31,7 @@ torch.backends.cuda.matmul.allow_tf32 = True
|
|
26 |
batch_size = 1
|
27 |
|
28 |
weights_path = "naver/" + 'MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric'
|
29 |
-
device = 'cuda'
|
30 |
model = AsymmetricMASt3R.from_pretrained(weights_path).to(device)
|
31 |
chkpt_tag = hash_md5(weights_path)
|
32 |
|
|
|
4 |
# --------------------------------------------------------
|
5 |
# masst3r demo
|
6 |
# --------------------------------------------------------
|
7 |
+
import spaces
|
8 |
import os
|
9 |
import sys
|
10 |
import os.path as path
|
|
|
15 |
MASt3R_REPO_PATH = path.normpath(path.join(HERE_PATH, './mast3r')) # noqa
|
16 |
sys.path.insert(0, MASt3R_REPO_PATH) # noqa
|
17 |
|
18 |
+
import mast3r.demo
|
19 |
+
mast3r.demo.get_reconstructed_scene = spaces.GPU(mast3r.demo.get_reconstructed_scene)
|
20 |
+
mast3r.demo.get_3D_model_from_scene = spaces.GPU(mast3r.demo.get_3D_model_from_scene)
|
21 |
+
|
22 |
from mast3r.demo import main_demo
|
23 |
from mast3r.model import AsymmetricMASt3R
|
24 |
from mast3r.utils.misc import hash_md5
|
|
|
31 |
batch_size = 1
|
32 |
|
33 |
weights_path = "naver/" + 'MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric'
|
34 |
+
device = 'cuda'
|
35 |
model = AsymmetricMASt3R.from_pretrained(weights_path).to(device)
|
36 |
chkpt_tag = hash_md5(weights_path)
|
37 |
|