Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions demo_colmap.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ def demo_fn(args):
print(f"Using dtype: {dtype}")

# Run VGGT for camera and depth estimation
model = VGGT()
model = VGGT().to(device)
_URL = "https://huggingface.co/facebook/VGGT-1B/resolve/main/model.pt"
model.load_state_dict(torch.hub.load_state_dict_from_url(_URL))
state_dict = torch.hub.load_state_dict_from_url(_URL, map_location=device)
model.load_state_dict(state_dict)
model.eval()
model = model.to(device)
print(f"Model loaded")
print(f"Model loaded to {device}")

# Get image paths and preprocess them
image_dir = os.path.join(args.scene_dir, "images")
Expand Down
9 changes: 4 additions & 5 deletions demo_gradio.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,12 @@
print("Initializing and loading VGGT model...")
# model = VGGT.from_pretrained("facebook/VGGT-1B") # another way to load the model

model = VGGT()
model = VGGT().to(device)
_URL = "https://huggingface.co/facebook/VGGT-1B/resolve/main/model.pt"
model.load_state_dict(torch.hub.load_state_dict_from_url(_URL))


state_dict = torch.hub.load_state_dict_from_url(_URL, map_location=device)
model.load_state_dict(state_dict)
model.eval()
model = model.to(device)
print(f"Model loaded to {device}")


# -------------------------------------------------------------------------
Expand Down
8 changes: 4 additions & 4 deletions demo_viser.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,12 @@ def main():
print("Initializing and loading VGGT model...")
# model = VGGT.from_pretrained("facebook/VGGT-1B")

model = VGGT()
model = VGGT().to(device)
_URL = "https://huggingface.co/facebook/VGGT-1B/resolve/main/model.pt"
model.load_state_dict(torch.hub.load_state_dict_from_url(_URL))

state_dict = torch.hub.load_state_dict_from_url(_URL, map_location=device)
model.load_state_dict(state_dict)
model.eval()
model = model.to(device)
print(f"Model loaded to {device}")

# Use the provided image folder path
print(f"Loading images from {args.image_folder}...")
Expand Down