-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
27 lines (18 loc) · 668 Bytes
/
app.py
File metadata and controls
27 lines (18 loc) · 668 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
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()
if __name__ == "__main__":
main()