tempdir
Browse files
app.py
CHANGED
@@ -11,6 +11,7 @@ import os.path as path
|
|
11 |
import torch
|
12 |
import tempfile
|
13 |
import gradio
|
|
|
14 |
|
15 |
HERE_PATH = path.normpath(path.dirname(__file__)) # noqa
|
16 |
MASt3R_REPO_PATH = path.normpath(path.join(HERE_PATH, './mast3r')) # noqa
|
@@ -32,7 +33,7 @@ device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
|
32 |
model = AsymmetricMASt3R.from_pretrained(weights_path).to(device)
|
33 |
chkpt_tag = hash_md5(weights_path)
|
34 |
|
35 |
-
tmpdirname =
|
36 |
image_size = 512
|
37 |
silent = True
|
38 |
gradio_delete_cache = 7200
|
@@ -167,3 +168,4 @@ with get_context(gradio_delete_cache) as demo:
|
|
167 |
clean_depth, transparent_cams, cam_size, TSDF_thresh],
|
168 |
outputs=outmodel)
|
169 |
demo.launch(share=None, server_name=None, server_port=None)
|
|
|
|
11 |
import torch
|
12 |
import tempfile
|
13 |
import gradio
|
14 |
+
import shutil
|
15 |
|
16 |
HERE_PATH = path.normpath(path.dirname(__file__)) # noqa
|
17 |
MASt3R_REPO_PATH = path.normpath(path.join(HERE_PATH, './mast3r')) # noqa
|
|
|
33 |
model = AsymmetricMASt3R.from_pretrained(weights_path).to(device)
|
34 |
chkpt_tag = hash_md5(weights_path)
|
35 |
|
36 |
+
tmpdirname = tempfile.mkdtemp(suffix='_mast3r_gradio_demo')
|
37 |
image_size = 512
|
38 |
silent = True
|
39 |
gradio_delete_cache = 7200
|
|
|
168 |
clean_depth, transparent_cams, cam_size, TSDF_thresh],
|
169 |
outputs=outmodel)
|
170 |
demo.launch(share=None, server_name=None, server_port=None)
|
171 |
+
shutil.rmtree(tmpdirname)
|