Update app.py
Browse files
app.py
CHANGED
@@ -3,26 +3,26 @@ from dust3r.demo import *
|
|
3 |
if True:
|
4 |
# parser = get_args_parser()
|
5 |
# args = parser.parse_args()
|
6 |
-
args = {
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
}
|
13 |
|
14 |
-
if args.tmp_dir is not None:
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
|
19 |
-
if args.server_name is not None:
|
20 |
server_name = args.server_name
|
21 |
else:
|
22 |
-
server_name = '0.0.0.0' if args.local_network else '127.0.0.1'
|
23 |
|
24 |
-
model = load_model(
|
25 |
# dust3r will write the 3D model inside tmpdirname
|
26 |
with tempfile.TemporaryDirectory(suffix='dust3r_gradio_demo') as tmpdirname:
|
27 |
print('Outputing stuff in', tmpdirname)
|
28 |
-
main_demo(tmpdirname, model,
|
|
|
3 |
if True:
|
4 |
# parser = get_args_parser()
|
5 |
# args = parser.parse_args()
|
6 |
+
# args = {
|
7 |
+
# "--weights": "./dust3r/checkpoints/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth",
|
8 |
+
# "tmp_dir": None,
|
9 |
+
# "server_name": None,
|
10 |
+
# "device": "cuda",
|
11 |
|
12 |
+
# }
|
13 |
|
14 |
+
# if args.tmp_dir is not None:
|
15 |
+
# tmp_path = args.tmp_dir
|
16 |
+
# os.makedirs(tmp_path, exist_ok=True)
|
17 |
+
# tempfile.tempdir = tmp_path
|
18 |
|
19 |
+
if False: #args.server_name is not None:
|
20 |
server_name = args.server_name
|
21 |
else:
|
22 |
+
server_name = '0.0.0.0' # if args.local_network else '127.0.0.1'
|
23 |
|
24 |
+
model = load_model("./dust3r/checkpoints/DUSt3R_ViTLarge_BaseDecoder_512_dpt.pth", "cuda")
|
25 |
# dust3r will write the 3D model inside tmpdirname
|
26 |
with tempfile.TemporaryDirectory(suffix='dust3r_gradio_demo') as tmpdirname:
|
27 |
print('Outputing stuff in', tmpdirname)
|
28 |
+
main_demo(tmpdirname, model, "cuda", 512, server_name, 7860)
|