-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (23 loc) · 790 Bytes
/
main.py
File metadata and controls
32 lines (23 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
import sys
import torch
sys.path.append(os.path.join(os.path.dirname(__file__), 'dust3r'))
from model import initialize
from gradio_ui import build_ui
from config import WEIGHTS_PATH, OUTPUT_DIR, SERVER_NAME, SERVER_PORT, SHARE, SHOW_ERROR
def main():
os.makedirs(OUTPUT_DIR, exist_ok=True)
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Using device: {device}")
print("Loading DUSt3R model...")
model = initialize(WEIGHTS_PATH, device)
print("Starting Multi-View 3D Reconstruction (MV3DR)...")
app = build_ui(OUTPUT_DIR, model, device)
app.launch(
server_name=SERVER_NAME,
server_port=SERVER_PORT,
share=SHARE,
show_error=SHOW_ERROR
)
if __name__ == "__main__":
main()