{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "GRUnii3wQSfI"
},
"outputs": [],
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "BBvXQhneQSfK"
},
"outputs": [],
"source": [
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "qDQLX3PArmh8"
},
"source": [
"# **dino-mast3r-gs**\n",
"#### **Gaussian Splat via Biplet-Square Normalization, DINO, MASt3R**
\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "g0gLgqSzQSfL"
},
"source": [
"https://www.kaggle.com/code/stpeteishii/british-museum-dino-lightglue-colmap-gs-12"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "qZtYJZJaQSfM"
},
"source": [
"\n",
"## Key Features of This Pipeline\n",
"\n",
"* **Utilization of MASt3R**: Employs the new **MASt3R** model, which achieved outstanding results at **IMC2025** (Image Matching Challenge 2025).\n",
"* **Process Integration**: MASt3R handles the tasks previously managed by the **ALIKED, LightGlue, and COLMAP** workflow mentioned in the previous notes.\n",
"* **Pipeline Workflow**: The updated data flow follows this sequence:\n",
"**Normalize → DINO → MASt3R → Gaussian Splatting**.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "W7O6kI6eQSfM"
},
"source": [
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "TzXf_eTxQsqq",
"outputId": "00b7b7a2-64ad-419c-946f-9c2748fd2723"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Mounted at /content/drive\n"
]
}
],
"source": [
"from google.colab import drive\n",
"drive.mount('/content/drive')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "gfxyotuCQSfM",
"outputId": "8938b8e4-41b9-41e9-f4c1-f0830a3d870a"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting pycolmap\n",
" Downloading pycolmap-3.13.0-cp312-cp312-manylinux_2_28_x86_64.whl.metadata (10 kB)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.12/dist-packages (from pycolmap) (2.0.2)\n",
"Downloading pycolmap-3.13.0-cp312-cp312-manylinux_2_28_x86_64.whl (20.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m20.3/20.3 MB\u001b[0m \u001b[31m68.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: pycolmap\n",
"Successfully installed pycolmap-3.13.0\n"
]
}
],
"source": [
"!pip install pycolmap"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "BW8ssNQ0QSfM"
},
"outputs": [],
"source": [
"# MASt3R-based Gaussian Splatting Pipeline\n",
"# Preserves: DINO pair selection + Biplet-Square Normalization\n",
"# Replaces: ALIKED/LightGlue/COLMAP with MASt3R\n",
"\n",
"import os\n",
"import sys\n",
"import gc\n",
"import h5py\n",
"import numpy as np\n",
"import torch\n",
"import torch.nn.functional as F\n",
"from tqdm import tqdm\n",
"from pathlib import Path\n",
"import subprocess\n",
"from PIL import Image, ImageFilter\n",
"import pycolmap\n",
"import struct\n",
"\n",
"# Transformers for DINO\n",
"from transformers import AutoImageProcessor, AutoModel\n",
"\n",
"# ============================================================================\n",
"# Configuration\n",
"# ============================================================================\n",
"class Config:\n",
" # Feature extraction\n",
" N_KEYPOINTS = 8192\n",
" IMAGE_SIZE = 1024\n",
"\n",
" # Pair selection - CRITICAL for memory\n",
" GLOBAL_TOPK = 20 # Reduced from 50 - each image pairs with top 20\n",
" MIN_MATCHES = 10\n",
" RATIO_THR = 1.2\n",
"\n",
" # Paths\n",
" DINO_MODEL = \"facebook/dinov2-base\"\n",
"\n",
" # MASt3R - Reduced size for memory\n",
" MAST3R_MODEL = \"/content/mast3r/checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth\"\n",
" MAST3R_IMAGE_SIZE = 224 # Small size to save memory\n",
"\n",
" # Device\n",
" DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')\n",
"\n",
"# ============================================================================\n",
"# Memory Management Utilities\n",
"# ============================================================================\n",
"\n",
"def clear_memory():\n",
" \"\"\"Aggressively clear GPU and CPU memory\"\"\"\n",
" gc.collect()\n",
" if torch.cuda.is_available():\n",
" torch.cuda.empty_cache()\n",
" torch.cuda.synchronize()\n",
"\n",
"def get_memory_info():\n",
" \"\"\"Get current memory usage\"\"\"\n",
" if torch.cuda.is_available():\n",
" allocated = torch.cuda.memory_allocated() / 1024**3\n",
" reserved = torch.cuda.memory_reserved() / 1024**3\n",
" print(f\"GPU Memory - Allocated: {allocated:.2f}GB, Reserved: {reserved:.2f}GB\")\n",
"\n",
" import psutil\n",
" cpu_mem = psutil.virtual_memory().percent\n",
" print(f\"CPU Memory Usage: {cpu_mem:.1f}%\")\n",
"\n",
"# ============================================================================\n",
"# Environment Setup\n",
"# ============================================================================\n",
"\n",
"def run_cmd(cmd, check=True, capture=False):\n",
" \"\"\"Run command with better error handling\"\"\"\n",
" print(f\"Running: {' '.join(cmd)}\")\n",
" result = subprocess.run(\n",
" cmd,\n",
" capture_output=capture,\n",
" text=True,\n",
" check=False\n",
" )\n",
" if check and result.returncode != 0:\n",
" print(f\"❌ Command failed with code {result.returncode}\")\n",
" if capture:\n",
" print(f\"STDOUT: {result.stdout}\")\n",
" print(f\"STDERR: {result.stderr}\")\n",
" return result\n",
"\n",
"\n",
"def setup_base_environment():\n",
" \"\"\"Setup base Python environment\"\"\"\n",
" print(\"\\n=== Setting up Base Environment ===\")\n",
"\n",
" # NumPy fix for Python 3.12\n",
" print(\"\\n📦 Fixing NumPy...\")\n",
" run_cmd([sys.executable, \"-m\", \"pip\", \"uninstall\", \"-y\", \"numpy\"])\n",
" run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"numpy==1.26.4\"])\n",
"\n",
" # PyTorch\n",
" print(\"\\n📦 Installing PyTorch...\")\n",
" run_cmd([\n",
" sys.executable, \"-m\", \"pip\", \"install\",\n",
" \"torch\", \"torchvision\", \"torchaudio\"\n",
" ])\n",
"\n",
" # Core utilities\n",
" print(\"\\n📦 Installing core utilities...\")\n",
" run_cmd([\n",
" sys.executable, \"-m\", \"pip\", \"install\",\n",
" \"opencv-python\",\n",
" \"pillow\",\n",
" \"imageio\",\n",
" \"imageio-ffmpeg\",\n",
" \"plyfile\",\n",
" \"tqdm\",\n",
" \"tensorboard\",\n",
" \"scipy\", # for rotation conversions and image resizing\n",
" \"psutil\" # for memory monitoring\n",
" ])\n",
"\n",
" # Transformers for DINO\n",
" print(\"\\n📦 Installing transformers...\")\n",
" run_cmd([\n",
" sys.executable, \"-m\", \"pip\", \"install\",\n",
" \"transformers==4.40.0\"\n",
" ])\n",
"\n",
" # pycolmap for COLMAP format\n",
" print(\"\\n📦 Installing pycolmap...\")\n",
" run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"pycolmap\"])\n",
"\n",
" print(\"✓ Base environment setup complete!\")\n",
"\n",
"\n",
"def setup_mast3r():\n",
" \"\"\"Install and setup MASt3R\"\"\"\n",
" print(\"\\n=== Setting up MASt3R ===\")\n",
"\n",
" os.chdir('/content')\n",
"\n",
" # Remove existing installation\n",
" if os.path.exists('mast3r'):\n",
" print(\"Removing existing MASt3R installation...\")\n",
" os.system('rm -rf mast3r')\n",
"\n",
" # Clone repository\n",
" print(\"Cloning MASt3R repository...\")\n",
" os.system('git clone --recursive https://github.com/naver/mast3r')\n",
" os.chdir('/content/mast3r')\n",
"\n",
" # Check dust3r directory\n",
" print(\"Checking dust3r structure...\")\n",
" os.system('ls -la dust3r/')\n",
"\n",
" # Install dust3r\n",
" print(\"Installing dust3r...\")\n",
" os.system('cd dust3r && python -m pip install -e .')\n",
"\n",
" # Install croco\n",
" print(\"Installing croco...\")\n",
" os.system('cd dust3r/croco && python -m pip install -e .')\n",
"\n",
" # Install requirements\n",
" print(\"Installing MASt3R requirements...\")\n",
" os.system('pip install -r requirements.txt')\n",
"\n",
" # Download model weights\n",
" print(\"Downloading model weights...\")\n",
" os.system('mkdir -p checkpoints')\n",
" os.system('wget -P checkpoints/ https://download.europe.naverlabs.com/ComputerVision/MASt3R/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth')\n",
"\n",
" # Install additional dependencies\n",
" print(\"Installing additional dependencies...\")\n",
" os.system('pip install trimesh matplotlib roma')\n",
"\n",
" # Add to path\n",
" sys.path.insert(0, '/content/mast3r')\n",
" sys.path.insert(0, '/content/mast3r/dust3r')\n",
"\n",
" # Verification\n",
" print(\"\\n🔍 Verifying MASt3R installation...\")\n",
" try:\n",
" from mast3r.model import AsymmetricMASt3R\n",
" print(\" ✓ MASt3R import: OK\")\n",
" except Exception as e:\n",
" print(f\" ❌ MASt3R import failed: {e}\")\n",
" raise\n",
"\n",
" print(\"✓ MASt3R setup complete!\")\n",
"\n",
"# ============================================================================\n",
"# Step 0: Biplet-Square Normalization (PRESERVED FROM ORIGINAL)\n",
"# ============================================================================\n",
"\n",
"def normalize_image_sizes_biplet(input_dir, output_dir=None, size=1024):\n",
" \"\"\"\n",
" Generates two square crops (Left & Right or Top & Bottom)\n",
" from each image in a directory.\n",
" \"\"\"\n",
" if output_dir is None:\n",
" output_dir = input_dir\n",
"\n",
" os.makedirs(output_dir, exist_ok=True)\n",
"\n",
" print(f\"Generating 2 cropped squares (Left/Right or Top/Bottom) for each image...\")\n",
" print()\n",
"\n",
" converted_count = 0\n",
" size_stats = {}\n",
"\n",
" for img_file in sorted(os.listdir(input_dir)):\n",
" if not img_file.lower().endswith(('.jpg', '.jpeg', '.png')):\n",
" continue\n",
"\n",
" input_path = os.path.join(input_dir, img_file)\n",
"\n",
" try:\n",
" img = Image.open(input_path)\n",
" original_size = img.size\n",
"\n",
" size_key = f\"{original_size[0]}x{original_size[1]}\"\n",
" size_stats[size_key] = size_stats.get(size_key, 0) + 1\n",
"\n",
" # Generate 2 crops\n",
" crops = generate_two_crops(img, size)\n",
"\n",
" base_name, ext = os.path.splitext(img_file)\n",
" for mode, cropped_img in crops.items():\n",
" output_path = os.path.join(output_dir, f\"{base_name}_{mode}{ext}\")\n",
" cropped_img.save(output_path, quality=95)\n",
"\n",
" converted_count += 1\n",
" print(f\" ✓ {img_file}: {original_size} → 2 square images generated\")\n",
"\n",
" except Exception as e:\n",
" print(f\" ✗ Error processing {img_file}: {e}\")\n",
"\n",
" print(f\"\\nProcessing complete: {converted_count} source images processed\")\n",
" print(f\"Original size distribution: {size_stats}\")\n",
" return converted_count\n",
"\n",
"\n",
"def generate_two_crops(img, size):\n",
" \"\"\"\n",
" Crops the image into a square and returns 2 variations\n",
" (Left/Right for landscape, Top/Bottom for portrait).\n",
" \"\"\"\n",
" width, height = img.size\n",
" crop_size = min(width, height)\n",
" crops = {}\n",
"\n",
" if width > height:\n",
" # Landscape → Left & Right\n",
" positions = {\n",
" 'left': 0,\n",
" 'right': width - crop_size\n",
" }\n",
" for mode, x_offset in positions.items():\n",
" box = (x_offset, 0, x_offset + crop_size, crop_size)\n",
" crops[mode] = img.crop(box).resize(\n",
" (size, size),\n",
" Image.Resampling.LANCZOS\n",
" )\n",
"\n",
" else:\n",
" # Portrait or Square → Top & Bottom\n",
" positions = {\n",
" 'top': 0,\n",
" 'bottom': height - crop_size\n",
" }\n",
" for mode, y_offset in positions.items():\n",
" box = (0, y_offset, crop_size, y_offset + crop_size)\n",
" crops[mode] = img.crop(box).resize(\n",
" (size, size),\n",
" Image.Resampling.LANCZOS\n",
" )\n",
"\n",
" return crops\n",
"\n",
"# ============================================================================\n",
"# Step 1: DINO-based Pair Selection (PRESERVED FROM ORIGINAL)\n",
"# ============================================================================\n",
"\n",
"def load_torch_image(fname, device):\n",
" \"\"\"Load image as torch tensor\"\"\"\n",
" import torchvision.transforms as T\n",
"\n",
" img = Image.open(fname).convert('RGB')\n",
" transform = T.Compose([\n",
" T.ToTensor(),\n",
" ])\n",
" return transform(img).unsqueeze(0).to(device)\n",
"\n",
"def extract_dino_global(image_paths, model_path, device):\n",
" \"\"\"Extract DINO global descriptors with memory management\"\"\"\n",
" print(\"\\n=== Extracting DINO Global Features ===\")\n",
" print(\"Initial memory state:\")\n",
" get_memory_info()\n",
"\n",
" processor = AutoImageProcessor.from_pretrained(model_path)\n",
" model = AutoModel.from_pretrained(model_path).eval().to(device)\n",
"\n",
" global_descs = []\n",
" batch_size = 4 # Small batch to save memory\n",
"\n",
" for i in tqdm(range(0, len(image_paths), batch_size)):\n",
" batch_paths = image_paths[i:i+batch_size]\n",
" batch_imgs = []\n",
"\n",
" for img_path in batch_paths:\n",
" img = load_torch_image(img_path, device)\n",
" batch_imgs.append(img)\n",
"\n",
" batch_tensor = torch.cat(batch_imgs, dim=0)\n",
"\n",
" with torch.no_grad():\n",
" inputs = processor(images=batch_tensor, return_tensors=\"pt\", do_rescale=False).to(device)\n",
" outputs = model(**inputs)\n",
" desc = F.normalize(outputs.last_hidden_state[:, 1:].max(dim=1)[0], dim=1, p=2)\n",
" global_descs.append(desc.cpu())\n",
"\n",
" # Clear batch memory\n",
" del batch_tensor, inputs, outputs, desc\n",
" clear_memory()\n",
"\n",
" global_descs = torch.cat(global_descs, dim=0)\n",
"\n",
" del model, processor\n",
" clear_memory()\n",
"\n",
" print(\"After DINO extraction:\")\n",
" get_memory_info()\n",
"\n",
" return global_descs\n",
"\n",
"def build_topk_pairs(global_feats, k, device):\n",
" \"\"\"Build top-k similar pairs from global features\"\"\"\n",
" g = global_feats.to(device)\n",
" sim = g @ g.T\n",
" sim.fill_diagonal_(-1)\n",
"\n",
" N = sim.size(0)\n",
" k = min(k, N - 1)\n",
"\n",
" topk_indices = torch.topk(sim, k, dim=1).indices.cpu()\n",
"\n",
" pairs = []\n",
" for i in range(N):\n",
" for j in topk_indices[i]:\n",
" j = j.item()\n",
" if i < j:\n",
" pairs.append((i, j))\n",
"\n",
" # Remove duplicates\n",
" pairs = list(set(pairs))\n",
"\n",
" return pairs\n",
"\n",
"def select_diverse_pairs(pairs, max_pairs, num_images):\n",
" \"\"\"\n",
" Select diverse pairs to ensure good image coverage\n",
" Strategy: Select pairs that maximize image coverage\n",
" \"\"\"\n",
" import random\n",
" random.seed(42)\n",
"\n",
" if len(pairs) <= max_pairs:\n",
" return pairs\n",
"\n",
" print(f\"Selecting {max_pairs} diverse pairs from {len(pairs)} candidates...\")\n",
"\n",
" # Count how many times each image appears in pairs\n",
" image_counts = {i: 0 for i in range(num_images)}\n",
" for i, j in pairs:\n",
" image_counts[i] += 1\n",
" image_counts[j] += 1\n",
"\n",
" # Sort pairs by: prefer pairs with less-connected images\n",
" def pair_score(pair):\n",
" i, j = pair\n",
" # Lower score = images appear in fewer pairs = more diverse\n",
" return image_counts[i] + image_counts[j]\n",
"\n",
" pairs_scored = [(pair, pair_score(pair)) for pair in pairs]\n",
" pairs_scored.sort(key=lambda x: x[1])\n",
"\n",
" # Select pairs greedily to maximize coverage\n",
" selected = []\n",
" selected_images = set()\n",
"\n",
" # Phase 1: Select pairs that add new images (greedy coverage)\n",
" for pair, score in pairs_scored:\n",
" if len(selected) >= max_pairs:\n",
" break\n",
" i, j = pair\n",
" # Prefer pairs that include new images\n",
" if i not in selected_images or j not in selected_images:\n",
" selected.append(pair)\n",
" selected_images.add(i)\n",
" selected_images.add(j)\n",
"\n",
" # Phase 2: Fill remaining slots with high-similarity pairs\n",
" if len(selected) < max_pairs:\n",
" remaining = [p for p, s in pairs_scored if p not in selected]\n",
" random.shuffle(remaining)\n",
" selected.extend(remaining[:max_pairs - len(selected)])\n",
"\n",
" print(f\"Selected pairs cover {len(selected_images)} / {num_images} images ({100*len(selected_images)/num_images:.1f}%)\")\n",
"\n",
" return selected\n",
"\n",
"def get_image_pairs_dino(image_paths, max_pairs=None):\n",
" \"\"\"DINO-based pair selection with intelligent limiting\"\"\"\n",
" device = Config.DEVICE\n",
"\n",
" # DINO global features\n",
" global_feats = extract_dino_global(image_paths, Config.DINO_MODEL, device)\n",
" pairs = build_topk_pairs(global_feats, Config.GLOBAL_TOPK, device)\n",
"\n",
" print(f\"Initial pairs from DINO: {len(pairs)}\")\n",
"\n",
" # Apply intelligent pair selection if limit specified\n",
" if max_pairs and len(pairs) > max_pairs:\n",
" pairs = select_diverse_pairs(pairs, max_pairs, len(image_paths))\n",
"\n",
" return pairs\n",
"\n",
"# ============================================================================\n",
"# Step 2: MASt3R Reconstruction (REPLACES ALIKED/LIGHTGLUE/COLMAP)\n",
"# ============================================================================\n",
"\n",
"def load_mast3r_model(device='cuda'):\n",
" \"\"\"Load MASt3R model\"\"\"\n",
" from mast3r.model import AsymmetricMASt3R\n",
"\n",
" model = AsymmetricMASt3R.from_pretrained(Config.MAST3R_MODEL).to(device)\n",
" model.eval()\n",
"\n",
" print(f\"✓ MASt3R model loaded on {device}\")\n",
" return model\n",
"\n",
"def load_images_for_mast3r(image_paths, size=224):\n",
" \"\"\"Load images using DUSt3R's format with reduced size\"\"\"\n",
" print(f\"\\n=== Loading images for MASt3R (size={size}) ===\")\n",
"\n",
" from dust3r.utils.image import load_images\n",
"\n",
" # Load images using DUSt3R's loader with reduced size\n",
" images = load_images(image_paths, size=size, verbose=True)\n",
"\n",
" return images\n",
"\n",
"def run_mast3r_pairs(model, image_paths, pairs, device='cuda', batch_size=1, max_pairs=None):\n",
" \"\"\"Run MASt3R on selected pairs with memory management\"\"\"\n",
" print(\"\\n=== Running MASt3R Reconstruction ===\")\n",
" print(\"Initial memory state:\")\n",
" get_memory_info()\n",
"\n",
" from dust3r.inference import inference\n",
" from dust3r.cloud_opt import global_aligner, GlobalAlignerMode\n",
"\n",
" # Limit number of pairs if specified\n",
" if max_pairs and len(pairs) > max_pairs:\n",
" print(f\"Limiting pairs from {len(pairs)} to {max_pairs}\")\n",
" # Select pairs more evenly distributed\n",
" step = max(1, len(pairs) // max_pairs)\n",
" pairs = pairs[::step][:max_pairs]\n",
"\n",
" print(f\"Processing {len(pairs)} pairs...\")\n",
"\n",
" # Load images in smaller size\n",
" print(f\"Loading {len(image_paths)} images at {Config.MAST3R_IMAGE_SIZE}x{Config.MAST3R_IMAGE_SIZE}...\")\n",
" images = load_images_for_mast3r(image_paths, size=Config.MAST3R_IMAGE_SIZE)\n",
"\n",
" print(f\"Loaded {len(images)} images\")\n",
" print(\"After loading images:\")\n",
" get_memory_info()\n",
"\n",
" # Create all image pairs at once\n",
" print(f\"Creating {len(pairs)} image pairs...\")\n",
" mast3r_pairs = []\n",
" for idx1, idx2 in tqdm(pairs, desc=\"Preparing pairs\"):\n",
" mast3r_pairs.append((images[idx1], images[idx2]))\n",
"\n",
" print(f\"Running MASt3R inference on {len(mast3r_pairs)} pairs...\")\n",
"\n",
" # Run inference (this returns the dict format we need)\n",
" output = inference(mast3r_pairs, model, device, batch_size=batch_size, verbose=True)\n",
"\n",
" # Clear pairs from memory\n",
" del mast3r_pairs\n",
" clear_memory()\n",
"\n",
" print(\"✓ MASt3R inference complete\")\n",
" print(\"After inference:\")\n",
" get_memory_info()\n",
"\n",
" # Global alignment\n",
" print(\"Running global alignment...\")\n",
" scene = global_aligner(\n",
" output,\n",
" device=device,\n",
" mode=GlobalAlignerMode.PointCloudOptimizer\n",
" )\n",
"\n",
" # Clear output after creating scene\n",
" del output\n",
" clear_memory()\n",
"\n",
" print(\"Computing global alignment...\")\n",
" loss = scene.compute_global_alignment(\n",
" init=\"mst\",\n",
" niter=150, # Reduced from 300\n",
" schedule='cosine',\n",
" lr=0.01\n",
" )\n",
"\n",
" print(f\"✓ Global alignment complete (final loss: {loss:.6f})\")\n",
" print(\"Final memory state:\")\n",
" get_memory_info()\n",
"\n",
" return scene, images"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "3jaKQxcDQSfN"
},
"outputs": [],
"source": [
"def extract_colmap_data(scene, image_paths, max_points=1000000):\n",
" \"\"\"\n",
" Extract COLMAP-compatible camera parameters and 3D points from MASt3R scene\n",
"\n",
" Args:\n",
" scene: MASt3R scene object\n",
" image_paths: List of image paths\n",
" max_points: Maximum number of 3D points to extract (default: 1M)\n",
" \"\"\"\n",
" print(\"\\n=== Extracting COLMAP-compatible data ===\")\n",
"\n",
" # Extract point cloud\n",
" pts_all = scene.get_pts3d()\n",
" print(f\"pts_all type: {type(pts_all)}\")\n",
"\n",
" if isinstance(pts_all, list):\n",
" print(f\"pts_all is a list with {len(pts_all)} elements\")\n",
" if len(pts_all) > 0:\n",
" print(f\"First element type: {type(pts_all[0])}\")\n",
" if hasattr(pts_all[0], 'shape'):\n",
" print(f\"First element shape: {pts_all[0].shape}\")\n",
"\n",
" pts_all = torch.stack([p if isinstance(p, torch.Tensor) else torch.tensor(p)\n",
" for p in pts_all])\n",
" print(f\"pts_all shape after conversion: {pts_all.shape}\")\n",
"\n",
" if len(pts_all.shape) == 4:\n",
" print(f\"Found batched point cloud: {pts_all.shape}\")\n",
" B, H, W, _ = pts_all.shape\n",
" pts3d = pts_all.reshape(-1, 3).detach().cpu().numpy()\n",
"\n",
" # Extract colors\n",
" colors = []\n",
" for img_path in image_paths:\n",
" img = Image.open(img_path).resize((W, H))\n",
" colors.append(np.array(img))\n",
" colors = np.stack(colors).reshape(-1, 3) / 255.0\n",
" else:\n",
" pts3d = pts_all.detach().cpu().numpy() if isinstance(pts_all, torch.Tensor) else pts_all # ← .detach() 追加\n",
" colors = np.ones((len(pts3d), 3)) * 0.5\n",
"\n",
" print(f\"✓ Extracted {len(pts3d)} 3D points from {len(image_paths)} images\")\n",
"\n",
" # **DOWNSAMPLE POINTS TO REDUCE MEMORY USAGE**\n",
" if len(pts3d) > max_points:\n",
" print(f\"\\n⚠ Downsampling from {len(pts3d)} to {max_points} points to reduce memory usage...\")\n",
"\n",
" # Remove invalid points first\n",
" valid_mask = ~(np.isnan(pts3d).any(axis=1) | np.isinf(pts3d).any(axis=1))\n",
" pts3d_valid = pts3d[valid_mask]\n",
" colors_valid = colors[valid_mask]\n",
"\n",
" # Random sampling\n",
" indices = np.random.choice(len(pts3d_valid), size=max_points, replace=False)\n",
" pts3d = pts3d_valid[indices]\n",
" colors = colors_valid[indices]\n",
"\n",
" print(f\"✓ Downsampled to {len(pts3d)} points\")\n",
"\n",
" # Extract camera parameters\n",
" print(\"Extracting camera parameters...\")\n",
"\n",
" # Get all poses at once\n",
" poses_tensor = scene.get_im_poses()\n",
" print(f\"Retrieved all poses at once: shape {poses_tensor.shape}\")\n",
" poses = poses_tensor.detach().cpu().numpy() # ← .detach() 追加\n",
"\n",
" cameras = []\n",
" for i, img_path in enumerate(image_paths):\n",
" img = Image.open(img_path)\n",
" W, H = img.size\n",
"\n",
" # Get intrinsics\n",
" K = scene.get_intrinsics()[i].detach().cpu().numpy() # ← .detach() 追加\n",
"\n",
" camera = {\n",
" 'camera_id': i + 1,\n",
" 'model': 'PINHOLE',\n",
" 'width': W,\n",
" 'height': H,\n",
" 'params': [K[0, 0], K[1, 1], K[0, 2], K[1, 2]]\n",
" }\n",
" cameras.append(camera)\n",
"\n",
" print(f\"✓ Extracted {len(cameras)} cameras and {len(poses)} poses\")\n",
"\n",
" return pts3d, colors, cameras, poses"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "vXQ7EHrrQSfO"
},
"outputs": [],
"source": [
"import struct\n",
"from pathlib import Path\n",
"\n",
"def save_colmap_reconstruction(pts3d, colors, cameras, poses, image_paths, output_dir):\n",
" \"\"\"Save reconstruction in COLMAP binary format by writing files directly\"\"\"\n",
" print(\"\\n=== Saving COLMAP reconstruction ===\")\n",
"\n",
" sparse_dir = Path(output_dir) / 'sparse' / '0'\n",
" sparse_dir.mkdir(parents=True, exist_ok=True)\n",
"\n",
" print(f\" Writing COLMAP files directly to {sparse_dir}...\")\n",
"\n",
" # Write cameras.bin\n",
" write_cameras_binary(cameras, sparse_dir / 'cameras.bin')\n",
" print(f\" ✓ Wrote {len(cameras)} cameras\")\n",
"\n",
" # Write images.bin\n",
" write_images_binary(image_paths, cameras, poses, sparse_dir / 'images.bin')\n",
" print(f\" ✓ Wrote {len(image_paths)} images\")\n",
"\n",
" # Write points3D.bin\n",
" num_points = write_points3d_binary(pts3d, colors, sparse_dir / 'points3D.bin')\n",
" print(f\" ✓ Wrote {num_points} 3D points\")\n",
"\n",
" print(f\"\\n✓ COLMAP reconstruction saved to {sparse_dir}\")\n",
" print(f\" Cameras: {len(cameras)}\")\n",
" print(f\" Images: {len(image_paths)}\")\n",
" print(f\" Points: {num_points}\")\n",
"\n",
" return sparse_dir\n",
"\n",
"\n",
"def write_cameras_binary(cameras, output_file):\n",
" \"\"\"Write cameras.bin in COLMAP binary format\"\"\"\n",
" with open(output_file, 'wb') as f:\n",
" # Write number of cameras\n",
" f.write(struct.pack('Q', len(cameras)))\n",
"\n",
" for i, cam in enumerate(cameras):\n",
" camera_id = cam.get('camera_id', i + 1)\n",
"\n",
" # Model ID: 1 = PINHOLE\n",
" model_id = 1\n",
" width = cam['width']\n",
" height = cam['height']\n",
" params = cam['params'] # [fx, fy, cx, cy]\n",
"\n",
" f.write(struct.pack('i', camera_id))\n",
" f.write(struct.pack('i', model_id))\n",
" f.write(struct.pack('Q', width))\n",
" f.write(struct.pack('Q', height))\n",
"\n",
" # Write 4 parameters for PINHOLE model\n",
" for param in params[:4]:\n",
" f.write(struct.pack('d', param))\n",
"\n",
"\n",
"def write_images_binary(image_paths, cameras, poses, output_file):\n",
" \"\"\"Write images.bin in COLMAP binary format\"\"\"\n",
" with open(output_file, 'wb') as f:\n",
" # Write number of images\n",
" f.write(struct.pack('Q', len(image_paths)))\n",
"\n",
" for i, (img_path, pose) in enumerate(zip(image_paths, poses)):\n",
" image_id = i + 1\n",
" camera_id = cameras[i].get('camera_id', i + 1)\n",
" image_name = os.path.basename(img_path)\n",
"\n",
" # Extract rotation and translation\n",
" R = pose[:3, :3]\n",
" t = pose[:3, 3]\n",
"\n",
" # Convert rotation matrix to quaternion [w, x, y, z]\n",
" qvec = rotmat2qvec(R)\n",
" tvec = t\n",
"\n",
" # Write image data\n",
" f.write(struct.pack('i', image_id))\n",
"\n",
" # Write quaternion (4 doubles)\n",
" for q in qvec:\n",
" f.write(struct.pack('d', float(q)))\n",
"\n",
" # Write translation vector (3 doubles)\n",
" for tv in tvec:\n",
" f.write(struct.pack('d', float(tv)))\n",
"\n",
" # Write camera ID\n",
" f.write(struct.pack('i', camera_id))\n",
"\n",
" # Write image name (null-terminated string)\n",
" f.write(image_name.encode('utf-8') + b'\\x00')\n",
"\n",
" # Write number of 2D points (0 for now, as we don't have 2D-3D correspondences)\n",
" f.write(struct.pack('Q', 0))\n",
"\n",
"\n",
"def write_points3d_binary(pts3d, colors, output_file):\n",
" \"\"\"Write points3D.bin in COLMAP binary format\"\"\"\n",
" # Filter out invalid points\n",
" valid_indices = []\n",
" for i, pt in enumerate(pts3d):\n",
" if not (np.isnan(pt).any() or np.isinf(pt).any()):\n",
" valid_indices.append(i)\n",
"\n",
" with open(output_file, 'wb') as f:\n",
" # Write number of points\n",
" f.write(struct.pack('Q', len(valid_indices)))\n",
"\n",
" for idx, point_id in enumerate(valid_indices):\n",
" pt = pts3d[point_id]\n",
" color = colors[point_id]\n",
"\n",
" # Write point3D ID\n",
" f.write(struct.pack('Q', point_id))\n",
"\n",
" # Write XYZ coordinates (3 doubles)\n",
" for coord in pt:\n",
" f.write(struct.pack('d', float(coord)))\n",
"\n",
" # Write RGB color (3 unsigned chars)\n",
" col_int = (color * 255).astype(np.uint8)\n",
" for c in col_int:\n",
" f.write(struct.pack('B', int(c)))\n",
"\n",
" # Write error (1 double) - set to 0\n",
" f.write(struct.pack('d', 0.0))\n",
"\n",
" # Write track length (number of images seeing this point)\n",
" # Set to 0 as we don't have track information\n",
" f.write(struct.pack('Q', 0))\n",
"\n",
" # Progress indicator\n",
" if (idx + 1) % 1000000 == 0:\n",
" print(f\" Wrote {idx + 1} / {len(valid_indices)} points...\")\n",
"\n",
" return len(valid_indices)\n",
"\n",
"\n",
"def rotmat2qvec(R):\n",
" \"\"\"\n",
" Convert rotation matrix to quaternion in COLMAP format [w, x, y, z]\n",
"\n",
" Args:\n",
" R: 3x3 rotation matrix\n",
"\n",
" Returns:\n",
" qvec: quaternion [w, x, y, z]\n",
" \"\"\"\n",
" # Ensure R is a numpy array\n",
" R = np.asarray(R, dtype=np.float64)\n",
"\n",
" # Calculate trace\n",
" trace = np.trace(R)\n",
"\n",
" if trace > 0:\n",
" s = 0.5 / np.sqrt(trace + 1.0)\n",
" w = 0.25 / s\n",
" x = (R[2, 1] - R[1, 2]) * s\n",
" y = (R[0, 2] - R[2, 0]) * s\n",
" z = (R[1, 0] - R[0, 1]) * s\n",
" elif R[0, 0] > R[1, 1] and R[0, 0] > R[2, 2]:\n",
" s = 2.0 * np.sqrt(1.0 + R[0, 0] - R[1, 1] - R[2, 2])\n",
" w = (R[2, 1] - R[1, 2]) / s\n",
" x = 0.25 * s\n",
" y = (R[0, 1] + R[1, 0]) / s\n",
" z = (R[0, 2] + R[2, 0]) / s\n",
" elif R[1, 1] > R[2, 2]:\n",
" s = 2.0 * np.sqrt(1.0 + R[1, 1] - R[0, 0] - R[2, 2])\n",
" w = (R[0, 2] - R[2, 0]) / s\n",
" x = (R[0, 1] + R[1, 0]) / s\n",
" y = 0.25 * s\n",
" z = (R[1, 2] + R[2, 1]) / s\n",
" else:\n",
" s = 2.0 * np.sqrt(1.0 + R[2, 2] - R[0, 0] - R[1, 1])\n",
" w = (R[1, 0] - R[0, 1]) / s\n",
" x = (R[0, 2] + R[2, 0]) / s\n",
" y = (R[1, 2] + R[2, 1]) / s\n",
" z = 0.25 * s\n",
"\n",
" qvec = np.array([w, x, y, z], dtype=np.float64)\n",
"\n",
" # Normalize\n",
" qvec = qvec / np.linalg.norm(qvec)\n",
"\n",
" return qvec"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "C0khcLW5QSfO"
},
"outputs": [],
"source": [
"# ============================================================================\n",
"# Step 3: Gaussian Splatting Training\n",
"# ============================================================================\n",
"\n",
"def setup_gaussian_splatting():\n",
" \"\"\"Setup Gaussian Splatting\"\"\"\n",
" print(\"\\n=== Setting up Gaussian Splatting ===\")\n",
"\n",
" os.chdir('/content')\n",
"\n",
" WORK_DIR = \"gaussian-splatting\"\n",
"\n",
" if not os.path.exists(WORK_DIR):\n",
" print(\"Cloning Gaussian Splatting repository...\")\n",
" run_cmd([\n",
" \"git\", \"clone\", \"--recursive\",\n",
" \"https://github.com/graphdeco-inria/gaussian-splatting.git\",\n",
" WORK_DIR\n",
" ])\n",
" else:\n",
" print(\"✓ Repository already exists\")\n",
"\n",
" os.chdir(WORK_DIR)\n",
"\n",
" # Install requirements\n",
" print(\"Installing Gaussian Splatting requirements...\")\n",
" run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"-r\", \"requirements.txt\"])\n",
"\n",
" # Build submodules\n",
" print(\"\\n📦 Building Gaussian Splatting submodules...\")\n",
"\n",
" submodules = {\n",
" \"diff-gaussian-rasterization\":\n",
" \"https://github.com/graphdeco-inria/diff-gaussian-rasterization.git\",\n",
" \"simple-knn\":\n",
" \"https://github.com/camenduru/simple-knn.git\"\n",
" }\n",
"\n",
" for name, repo in submodules.items():\n",
" print(f\"\\n📦 Installing {name}...\")\n",
" path = os.path.join(\"submodules\", name)\n",
" if not os.path.exists(path):\n",
" run_cmd([\"git\", \"clone\", repo, path])\n",
" run_cmd([sys.executable, \"-m\", \"pip\", \"install\", path])\n",
"\n",
" print(\"✓ Gaussian Splatting setup complete!\")\n",
"\n",
"\n",
"def train_gaussian_splatting(colmap_dir, image_dir, output_dir, iterations=2000):\n",
" \"\"\"Train Gaussian Splatting model\"\"\"\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 6: Training Gaussian Splatting\")\n",
" print(\"=\"*70)\n",
"\n",
" print(\"\\n=== Training Gaussian Splatting ===\")\n",
"\n",
" # Reduce memory usage with smaller resolution\n",
" cmd = [\n",
" 'python', 'train.py',\n",
" '-s', colmap_dir,\n",
" '--images', image_dir,\n",
" '-m', output_dir,\n",
" '--iterations', str(iterations),\n",
" '--test_iterations', '1000', str(iterations),\n",
" '--save_iterations', '1000', str(iterations),\n",
" '--resolution', '2', # Reduce resolution to 1/2\n",
" '--densify_grad_threshold', '0.001', # Higher threshold = fewer Gaussians\n",
" '--densification_interval', '200', # Less frequent densification\n",
" '--opacity_reset_interval', '5000', # Less frequent reset\n",
" ]\n",
"\n",
" print(f\"Command: {' '.join(cmd)}\\n\")\n",
"\n",
" result = subprocess.run(\n",
" cmd,\n",
" cwd='/content/gaussian-splatting',\n",
" capture_output=True,\n",
" text=True\n",
" )\n",
"\n",
" print(result.stdout)\n",
" if result.stderr:\n",
" print(\"STDERR:\", result.stderr)\n",
"\n",
" if result.returncode != 0:\n",
" raise RuntimeError(\"Gaussian Splatting training failed\")\n",
"\n",
" # Check output\n",
" if not os.path.exists(os.path.join(output_dir, f'point_cloud/iteration_{iterations}/point_cloud.ply')):\n",
" raise RuntimeError(f\"Expected output not found at iteration {iterations}\")\n",
"\n",
" print(f\"\\n✓ Gaussian Splatting training completed successfully\")\n",
" print(f\" Output: {output_dir}\")\n",
"\n",
" return output_dir"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "utQCdljBQSfO"
},
"outputs": [],
"source": [
"# ============================================================================\n",
"# Main Pipeline\n",
"# ============================================================================\n",
"def main_pipeline(image_dir, output_dir, square_size=224, iterations=2000,\n",
" max_images=None, max_pairs=10000, max_points=100000):\n",
" \"\"\"\n",
" Main pipeline for DINO matching -> MASt3R -> Gaussian Splatting\n",
"\n",
" Args:\n",
" image_dir: Directory containing input images\n",
" output_dir: Directory for output files\n",
" square_size: Size to resize images for processing\n",
" iterations: Number of training iterations\n",
" max_images: Maximum number of images to process (None = all)\n",
" max_pairs: Maximum number of image pairs for matching\n",
" max_points: Maximum number of 3D points to extract (default: 1M)\n",
" \"\"\"\n",
" os.makedirs(output_dir, exist_ok=True)\n",
"\n",
" setup_base_environment()\n",
" clear_memory()\n",
"\n",
" setup_mast3r()\n",
" clear_memory()\n",
"\n",
" setup_gaussian_splatting()\n",
" clear_memory()\n",
"\n",
" # Step 1: Normalize images to biplet-square format\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 1: Biplet-Square Normalization\")\n",
" print(\"=\"*70)\n",
"\n",
" processed_image_dir = os.path.join(output_dir, \"processed_images\")\n",
"\n",
" # Get original images first\n",
" original_image_paths = sorted([\n",
" os.path.join(image_dir, f)\n",
" for f in os.listdir(image_dir)\n",
" if f.lower().endswith(('.jpg', '.jpeg', '.png'))\n",
" ])\n",
"\n",
" # Limit original images if specified\n",
" if max_images and len(original_image_paths) > max_images:\n",
" print(f\"\\n⚠️ Limiting to {max_images} original images\")\n",
" original_image_paths = original_image_paths[:max_images]\n",
"\n",
" print(f\"Processing {len(original_image_paths)} original images → ~{len(original_image_paths)*2} after biplet-square\")\n",
"\n",
" # Only process the selected images\n",
" temp_dir = os.path.join(output_dir, \"temp_originals\")\n",
" os.makedirs(temp_dir, exist_ok=True)\n",
"\n",
" # Copy selected images to temp directory\n",
" for img_path in original_image_paths:\n",
" import shutil\n",
" shutil.copy(img_path, temp_dir)\n",
"\n",
" # Process the temp directory\n",
" normalize_image_sizes_biplet(\n",
" input_dir=temp_dir,\n",
" output_dir=processed_image_dir,\n",
" size=square_size\n",
" )\n",
"\n",
" # Clean up temp directory\n",
" shutil.rmtree(temp_dir)\n",
"\n",
" # Get processed image paths\n",
" image_paths = sorted([\n",
" os.path.join(processed_image_dir, f)\n",
" for f in os.listdir(processed_image_dir)\n",
" if f.lower().endswith(('.jpg', '.jpeg', '.png'))\n",
" ])\n",
"\n",
" print(f\"\\n📸 Processing {len(image_paths)} images (after biplet-square)\")\n",
" print(f\"⚠️ Will use maximum {max_pairs} pairs to save memory\")\n",
"\n",
" # Step 2: DINO-based pair selection\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 2: DINO Pair Selection\")\n",
" print(\"=\"*70)\n",
"\n",
" pairs = get_image_pairs_dino(image_paths, max_pairs=max_pairs)\n",
" clear_memory()\n",
"\n",
" print(f\"✓ Using {len(pairs)} pairs for reconstruction\")\n",
"\n",
" # Step 3: MASt3R reconstruction\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 3: MASt3R Reconstruction\")\n",
" print(\"=\"*70)\n",
"\n",
" device = Config.DEVICE\n",
" model = load_mast3r_model(device)\n",
"\n",
" scene, mast3r_images = run_mast3r_pairs(\n",
" model, image_paths, pairs, device,\n",
" max_pairs=None # Already limited in get_image_pairs_dino\n",
" )\n",
"\n",
" # Clear model from memory\n",
" del model\n",
" clear_memory()\n",
"\n",
" # Step 4: Extract COLMAP-compatible data\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 4: Converting to COLMAP Format\")\n",
" print(\"=\"*70)\n",
"\n",
" # Extract COLMAP-compatible data with point limit\n",
" pts3d, colors, cameras, poses = extract_colmap_data(\n",
" scene, image_paths, max_points=max_points\n",
" )\n",
"\n",
" # Clear scene from memory\n",
" del scene, mast3r_images\n",
" clear_memory()\n",
"\n",
" # Step 5: Save COLMAP reconstruction\n",
" colmap_dir = os.path.join(output_dir, 'colmap')\n",
" sparse_dir = save_colmap_reconstruction(\n",
" pts3d, colors, cameras, poses, image_paths, colmap_dir\n",
" )\n",
"\n",
" # Clear reconstruction data\n",
" del pts3d, colors, cameras, poses\n",
" clear_memory()\n",
"\n",
" # Step 6: Train Gaussian Splatting\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"Step 6: Training Gaussian Splatting\")\n",
" print(\"=\"*70)\n",
"\n",
" gs_output = train_gaussian_splatting(\n",
" colmap_dir=colmap_dir,\n",
" image_dir=processed_image_dir,\n",
" output_dir=output_dir,\n",
" iterations=iterations\n",
" )\n",
"\n",
" print(\"\\n\" + \"=\"*70)\n",
" print(\"✅ Full Pipeline Successfully Completed!\")\n",
" print(\"=\"*70)\n",
" print(f\"\\nGaussian Splatting model saved at: {gs_output}\")\n",
"\n",
" return gs_output"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"background_save": true,
"base_uri": "https://localhost:8080/",
"height": 1000,
"referenced_widgets": [
"56c4d394433042ddb623ce1bc8d1fcbc",
"ded19df53c3146f998f171886c09e01d",
"f5b94d4b0a5e4aa5b5c19da0c8da7640",
"e285e0404c2144aa9d07b441c08f27c6",
"4b37615c58fc49fca937aeeafdd64a03",
"3a13744929ca41fb82ab0f659106d58e",
"3b17bfa9844446f9a7433232bf86c05f",
"cb85c5bb008c4c2d9caedb86b3b09688",
"64c215802af240d1bc4b5b4df02238a4",
"f98b4ae9a1d849539a0be9a88d5ba59c",
"6050a334e28248fe8c4e3c2bbe71ba34",
"5a787fde581b4b53858314f41f9d3e5a",
"d7e3b503e7c24f1f8290366f354e54fc",
"838308596d3b41919e7e89b8e136aeb0",
"63bb65b77d114c9bb9c3cca3c6e19e31",
"293756b1586744079ce0cd5f63d24b7b",
"10003a3c3e474babb416a393569aec43",
"b9124a12e2854d0187b35969edfeaec7",
"7c341652d3b24622ad0d2de52988f259",
"084cc3b7c4b54d8e85675c82f2d69565",
"21a9dc812dc545d8bf399317c742f53f",
"6a5f159e804e4b3685a3f84e6ab40231",
"1e5f1e24aff34f5d9f495a6e18202362",
"87f09bf010d24d85b6d1dc4aac7b9f02",
"8d3373142a12430aa3e762a70dcc30f4",
"6f739e161bbf4c1bb74c4e450fb25335",
"d735b4443f9b43faa7dd9036d05449d6",
"422dd0806162460f9a86ae5fed7a020b",
"963b342842a1461f8e7309e62251b674",
"527dfa8fbbfc4bcfa758204415665e27",
"4056583d511245119273d7175acc9ad3",
"e07f84b2794b4e008a86c7f35bce8e1f",
"f6dca76516144c5b8f8123fdfb09cf80"
]
},
"id": "3dIlSxVMQSfO",
"outputId": "6aeaa74f-e1cf-4668-b931-d879c166c335"
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"=== Setting up Base Environment ===\n",
"\n",
"📦 Fixing NumPy...\n",
"Running: /usr/bin/python3 -m pip uninstall -y numpy\n",
"Running: /usr/bin/python3 -m pip install numpy==1.26.4\n",
"\n",
"📦 Installing PyTorch...\n",
"Running: /usr/bin/python3 -m pip install torch torchvision torchaudio\n",
"\n",
"📦 Installing core utilities...\n",
"Running: /usr/bin/python3 -m pip install opencv-python pillow imageio imageio-ffmpeg plyfile tqdm tensorboard scipy psutil\n",
"\n",
"📦 Installing transformers...\n",
"Running: /usr/bin/python3 -m pip install transformers==4.40.0\n",
"\n",
"📦 Installing pycolmap...\n",
"Running: /usr/bin/python3 -m pip install pycolmap\n",
"✓ Base environment setup complete!\n",
"\n",
"=== Setting up MASt3R ===\n",
"Cloning MASt3R repository...\n",
"Checking dust3r structure...\n",
"Installing dust3r...\n",
"Installing croco...\n",
"Installing MASt3R requirements...\n",
"Downloading model weights...\n",
"Installing additional dependencies...\n",
"\n",
"🔍 Verifying MASt3R installation...\n",
"Warning, cannot find cuda-compiled version of RoPE2D, using a slow pytorch version instead\n",
" ✓ MASt3R import: OK\n",
"✓ MASt3R setup complete!\n",
"\n",
"=== Setting up Gaussian Splatting ===\n",
"Cloning Gaussian Splatting repository...\n",
"Running: git clone --recursive https://github.com/graphdeco-inria/gaussian-splatting.git gaussian-splatting\n",
"Installing Gaussian Splatting requirements...\n",
"Running: /usr/bin/python3 -m pip install -r requirements.txt\n",
"❌ Command failed with code 1\n",
"\n",
"📦 Building Gaussian Splatting submodules...\n",
"\n",
"📦 Installing diff-gaussian-rasterization...\n",
"Running: /usr/bin/python3 -m pip install submodules/diff-gaussian-rasterization\n",
"\n",
"📦 Installing simple-knn...\n",
"Running: /usr/bin/python3 -m pip install submodules/simple-knn\n",
"✓ Gaussian Splatting setup complete!\n",
"\n",
"======================================================================\n",
"Step 1: Biplet-Square Normalization\n",
"======================================================================\n",
"Processing 120 original images → ~240 after biplet-square\n",
"Generating 2 cropped squares (Left/Right or Top/Bottom) for each image...\n",
"\n",
" ✓ 30060098_13881136865.jpg: (1045, 776) → 2 square images generated\n",
" ✓ 30932426_9182415658.jpg: (1066, 693) → 2 square images generated\n",
" ✓ 31608163_6102133633.jpg: (1013, 757) → 2 square images generated\n",
" ✓ 32234104_183977071.jpg: (1056, 780) → 2 square images generated\n",
" ✓ 54689750_8177752931.jpg: (780, 1056) → 2 square images generated\n",
" ✓ 54789298_4426358141.jpg: (1041, 774) → 2 square images generated\n",
" ✓ 54924303_8694631531.jpg: (1020, 680) → 2 square images generated\n",
" ✓ 55042300_2998445423.jpg: (780, 1056) → 2 square images generated\n",
" ✓ 56336675_12025095504.jpg: (1030, 693) → 2 square images generated\n",
" ✓ 56571846_8147517032.jpg: (1039, 773) → 2 square images generated\n",
" ✓ 56929508_8486048059.jpg: (1021, 765) → 2 square images generated\n",
" ✓ 57895262_5823807439.jpg: (1072, 786) → 2 square images generated\n",
" ✓ 57903036_6034663613.jpg: (1014, 758) → 2 square images generated\n",
" ✓ 58370062_228935435.jpg: (1047, 776) → 2 square images generated\n",
" ✓ 60409409_9335730523.jpg: (1032, 684) → 2 square images generated\n",
" ✓ 61195081_2862626518.jpg: (506, 377) → 2 square images generated\n",
" ✓ 61353083_128372808.jpg: (606, 816) → 2 square images generated\n",
" ✓ 61442570_1877638298.jpg: (935, 1081) → 2 square images generated\n",
" ✓ 61931752_11269229804.jpg: (374, 501) → 2 square images generated\n",
" ✓ 62109065_5110187734.jpg: (1021, 769) → 2 square images generated\n",
" ✓ 63023054_7575192460.jpg: (777, 1049) → 2 square images generated\n",
" ✓ 63358653_3107448586.jpg: (1021, 683) → 2 square images generated\n",
" ✓ 63732276_3020022441.jpg: (692, 1068) → 2 square images generated\n",
" ✓ 63831138_11531850475.jpg: (1057, 689) → 2 square images generated\n",
" ✓ 63879656_8828566618.jpg: (1026, 768) → 2 square images generated\n",
" ✓ 64133734_1372277262.jpg: (1047, 688) → 2 square images generated\n",
" ✓ 64177922_6939801959.jpg: (1065, 651) → 2 square images generated\n",
" ✓ 64512286_144258707.jpg: (689, 1050) → 2 square images generated\n",
" ✓ 64752693_9379071376.jpg: (760, 1027) → 2 square images generated\n",
" ✓ 65596895_2998348333.jpg: (786, 1072) → 2 square images generated\n",
" ✓ 65600629_2179631506.jpg: (1041, 774) → 2 square images generated\n",
" ✓ 65723931_2797767702.jpg: (1061, 782) → 2 square images generated\n",
" ✓ 66906958_589662361.jpg: (1053, 779) → 2 square images generated\n",
" ✓ 67684501_389553533.jpg: (1020, 764) → 2 square images generated\n",
" ✓ 68173000_3055082929.jpg: (719, 1052) → 2 square images generated\n",
" ✓ 68388628_416361462.jpg: (1067, 784) → 2 square images generated\n",
" ✓ 68664732_743450957.jpg: (778, 1052) → 2 square images generated\n",
" ✓ 69151734_8072413114.jpg: (1021, 677) → 2 square images generated\n",
" ✓ 69241373_2334905294.jpg: (1047, 776) → 2 square images generated\n",
" ✓ 69675366_3578017198.jpg: (1057, 780) → 2 square images generated\n",
" ✓ 70032246_6347641014.jpg: (117, 204) → 2 square images generated\n",
" ✓ 70699652_8066487031.jpg: (204, 114) → 2 square images generated\n",
" ✓ 71316394_5233978047.jpg: (1033, 771) → 2 square images generated\n",
" ✓ 71521166_8226626351.jpg: (1013, 757) → 2 square images generated\n",
" ✓ 72075679_2232424648.jpg: (1045, 776) → 2 square images generated\n",
" ✓ 72598875_8072411042.jpg: (680, 1032) → 2 square images generated\n",
" ✓ 72646474_2231631573.jpg: (1048, 777) → 2 square images generated\n",
" ✓ 73543943_6819377449.jpg: (1064, 783) → 2 square images generated\n",
" ✓ 74323184_6819378543.jpg: (1061, 782) → 2 square images generated\n",
" ✓ 74379252_3524899450.jpg: (1066, 784) → 2 square images generated\n",
" ✓ 74949128_744301420.jpg: (1055, 780) → 2 square images generated\n",
" ✓ 75556369_8486047615.jpg: (756, 1009) → 2 square images generated\n",
" ✓ 75670494_10532227934.jpg: (1045, 776) → 2 square images generated\n",
" ✓ 75795010_1073028.jpg: (513, 380) → 2 square images generated\n",
" ✓ 75963148_11531980813.jpg: (1062, 690) → 2 square images generated\n",
" ✓ 76012163_5234572012.jpg: (1057, 780) → 2 square images generated\n",
" ✓ 76033783_4998492930.jpg: (1075, 694) → 2 square images generated\n",
" ✓ 76893682_2999450842.jpg: (1036, 772) → 2 square images generated\n",
" ✓ 77082765_2334078741.jpg: (780, 1055) → 2 square images generated\n",
" ✓ 77322980_4097421297.jpg: (775, 1044) → 2 square images generated\n",
" ✓ 77502589_7155532159.jpg: (1010, 1010) → 2 square images generated\n",
" ✓ 78461576_2179633616.jpg: (1044, 776) → 2 square images generated\n",
" ✓ 78756975_2797764270.jpg: (1060, 782) → 2 square images generated\n",
" ✓ 80159334_3432556478.jpg: (610, 822) → 2 square images generated\n",
" ✓ 80238669_11531890454.jpg: (1026, 680) → 2 square images generated\n",
" ✓ 80394863_159173947.jpg: (1048, 777) → 2 square images generated\n",
" ✓ 80419518_5109586935.jpg: (1026, 772) → 2 square images generated\n",
" ✓ 80486775_7794448262.jpg: (1007, 756) → 2 square images generated\n",
" ✓ 80637823_2178834461.jpg: (773, 1039) → 2 square images generated\n",
" ✓ 82494139_2231488841.jpg: (1040, 774) → 2 square images generated\n",
" ✓ 82619588_2231634419.jpg: (1041, 774) → 2 square images generated\n",
" ✓ 83049944_6012584465.jpg: (689, 1047) → 2 square images generated\n",
" ✓ 83295590_2999194388.jpg: (1061, 782) → 2 square images generated\n",
" ✓ 83393115_2713666377.jpg: (1057, 691) → 2 square images generated\n",
" ✓ 83494299_9338552580.jpg: (1032, 684) → 2 square images generated\n",
" ✓ 83683619_338844451.jpg: (1060, 782) → 2 square images generated\n",
" ✓ 83880039_8704930508.jpg: (1065, 696) → 2 square images generated\n",
" ✓ 84280780_9149810125.jpg: (698, 1070) → 2 square images generated\n",
" ✓ 84416532_1372248960.jpg: (1047, 689) → 2 square images generated\n",
" ✓ 85875165_3423168615.jpg: (1009, 670) → 2 square images generated\n",
" ✓ 87021942_9387960095.jpg: (692, 1060) → 2 square images generated\n",
" ✓ 87218542_4659693663.jpg: (1051, 690) → 2 square images generated\n",
" ✓ 87247686_240007777.jpg: (1056, 780) → 2 square images generated\n",
" ✓ 87692684_217109210.jpg: (613, 454) → 2 square images generated\n",
" ✓ 88392746_217109207.jpg: (612, 454) → 2 square images generated\n",
" ✓ 89270148_8703811409.jpg: (1064, 696) → 2 square images generated\n",
" ✓ 89428328_415853343.jpg: (1041, 774) → 2 square images generated\n",
" ✓ 89821764_2714509360.jpg: (768, 1026) → 2 square images generated\n",
" ✓ 89912815_3055922954.jpg: (1021, 543) → 2 square images generated\n",
" ✓ 90349736_2179635862.jpg: (1038, 773) → 2 square images generated\n",
" ✓ 90437703_2231631681.jpg: (776, 1046) → 2 square images generated\n",
" ✓ 90505934_1674425132.jpg: (781, 595) → 2 square images generated\n",
" ✓ 90635649_2575304688.jpg: (1033, 683) → 2 square images generated\n",
" ✓ 90975523_4819480082.jpg: (1070, 698) → 2 square images generated\n",
" ✓ 91086090_6251487936.jpg: (774, 1041) → 2 square images generated\n",
" ✓ 91147360_7119433063.jpg: (756, 1012) → 2 square images generated\n",
" ✓ 91223537_687114481.jpg: (696, 1078) → 2 square images generated\n",
" ✓ 91887585_2717484563.jpg: (1024, 628) → 2 square images generated\n",
" ✓ 91966016_2575756133.jpg: (1054, 779) → 2 square images generated\n",
" ✓ 92092453_6346876777.jpg: (644, 1094) → 2 square images generated\n",
" ✓ 92332702_2575760403.jpg: (1056, 780) → 2 square images generated\n",
" ✓ 93176024_7794453938.jpg: (975, 563) → 2 square images generated\n",
" ✓ 93452424_2796919411.jpg: (783, 1064) → 2 square images generated\n",
" ✓ 93855352_2178846945.jpg: (1047, 777) → 2 square images generated\n",
" ✓ 94589793_5911133174.jpg: (971, 643) → 2 square images generated\n",
" ✓ 94608068_9152036176.jpg: (1029, 686) → 2 square images generated\n",
" ✓ 95763587_2232280810.jpg: (1043, 775) → 2 square images generated\n",
" ✓ 95912681_1074872458.jpg: (1199, 556) → 2 square images generated\n",
" ✓ 96196686_8643079931.jpg: (1035, 772) → 2 square images generated\n",
" ✓ 96969581_4970715984.jpg: (1004, 1004) → 2 square images generated\n",
" ✓ 97044761_5284916914.jpg: (689, 1047) → 2 square images generated\n",
" ✓ 97169342_4819482004.jpg: (1020, 683) → 2 square images generated\n",
" ✓ 97408314_4660309480.jpg: (1052, 778) → 2 square images generated\n",
" ✓ 97679107_216044726.jpg: (1028, 769) → 2 square images generated\n",
" ✓ 98096144_7465571668.jpg: (1035, 1035) → 2 square images generated\n",
" ✓ 98217251_4097423171.jpg: (1032, 770) → 2 square images generated\n",
" ✓ 98347882_247481604.jpg: (1057, 691) → 2 square images generated\n",
" ✓ 98365344_176581376.jpg: (1049, 777) → 2 square images generated\n",
" ✓ 98413296_389554202.jpg: (1059, 781) → 2 square images generated\n",
" ✓ 99829338_590024774.jpg: (1055, 780) → 2 square images generated\n",
"\n",
"Processing complete: 120 source images processed\n",
"Original size distribution: {'1045x776': 3, '1066x693': 1, '1013x757': 2, '1056x780': 3, '780x1056': 2, '1041x774': 4, '1020x680': 1, '1030x693': 1, '1039x773': 1, '1021x765': 1, '1072x786': 1, '1014x758': 1, '1047x776': 2, '1032x684': 2, '506x377': 1, '606x816': 1, '935x1081': 1, '374x501': 1, '1021x769': 1, '777x1049': 1, '1021x683': 1, '692x1068': 1, '1057x689': 1, '1026x768': 1, '1047x688': 1, '1065x651': 1, '689x1050': 1, '760x1027': 1, '786x1072': 1, '1061x782': 3, '1053x779': 1, '1020x764': 1, '719x1052': 1, '1067x784': 1, '778x1052': 1, '1021x677': 1, '1057x780': 2, '117x204': 1, '204x114': 1, '1033x771': 1, '680x1032': 1, '1048x777': 2, '1064x783': 1, '1066x784': 1, '1055x780': 2, '756x1009': 1, '513x380': 1, '1062x690': 1, '1075x694': 1, '1036x772': 1, '780x1055': 1, '775x1044': 1, '1010x1010': 1, '1044x776': 1, '1060x782': 2, '610x822': 1, '1026x680': 1, '1026x772': 1, '1007x756': 1, '773x1039': 1, '1040x774': 1, '689x1047': 2, '1057x691': 2, '1065x696': 1, '698x1070': 1, '1047x689': 1, '1009x670': 1, '692x1060': 1, '1051x690': 1, '613x454': 1, '612x454': 1, '1064x696': 1, '768x1026': 1, '1021x543': 1, '1038x773': 1, '776x1046': 1, '781x595': 1, '1033x683': 1, '1070x698': 1, '774x1041': 1, '756x1012': 1, '696x1078': 1, '1024x628': 1, '1054x779': 1, '644x1094': 1, '975x563': 1, '783x1064': 1, '1047x777': 1, '971x643': 1, '1029x686': 1, '1043x775': 1, '1199x556': 1, '1035x772': 1, '1004x1004': 1, '1020x683': 1, '1052x778': 1, '1028x769': 1, '1035x1035': 1, '1032x770': 1, '1049x777': 1, '1059x781': 1}\n",
"\n",
"📸 Processing 240 images (after biplet-square)\n",
"⚠️ Will use maximum 400 pairs to save memory\n",
"\n",
"======================================================================\n",
"Step 2: DINO Pair Selection\n",
"======================================================================\n",
"\n",
"=== Extracting DINO Global Features ===\n",
"Initial memory state:\n",
"GPU Memory - Allocated: 0.00GB, Reserved: 0.00GB\n",
"CPU Memory Usage: 4.7%\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:94: UserWarning: \n",
"The secret `HF_TOKEN` does not exist in your Colab secrets.\n",
"To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n",
"You will be able to reuse this secret in all of your notebooks.\n",
"Please note that authentication is recommended but still optional to access public models or datasets.\n",
" warnings.warn(\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "56c4d394433042ddb623ce1bc8d1fcbc",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"preprocessor_config.json: 0%| | 0.00/436 [00:00, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Using a slow image processor as `use_fast` is unset and a slow processor was saved with this model. `use_fast=True` will be the default behavior in v4.52, even if the model was saved with a slow processor. This will result in minor differences in outputs. You'll still be able to use a slow processor with `use_fast=False`.\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "5a787fde581b4b53858314f41f9d3e5a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"config.json: 0%| | 0.00/548 [00:00, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1e5f1e24aff34f5d9f495a6e18202362",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"model.safetensors: 0%| | 0.00/346M [00:00, ?B/s]"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 60/60 [00:30<00:00, 1.98it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"After DINO extraction:\n",
"GPU Memory - Allocated: 0.02GB, Reserved: 0.06GB\n",
"CPU Memory Usage: 5.7%\n",
"Initial pairs from DINO: 2372\n",
"Selecting 400 diverse pairs from 2372 candidates...\n",
"Selected pairs cover 240 / 240 images (100.0%)\n",
"✓ Using 400 pairs for reconstruction\n",
"\n",
"======================================================================\n",
"Step 3: MASt3R Reconstruction\n",
"======================================================================\n",
"... loading model from /content/mast3r/checkpoints/MASt3R_ViTLarge_BaseDecoder_512_catmlpdpt_metric.pth\n",
"instantiating : AsymmetricMASt3R(enc_depth=24, dec_depth=12, enc_embed_dim=1024, dec_embed_dim=768, enc_num_heads=16, dec_num_heads=12, pos_embed='RoPE100',img_size=(512, 512), head_type='catmlp+dpt', output_mode='pts3d+desc24', depth_mode=('exp', -inf, inf), conf_mode=('exp', 1, inf), patch_embed_cls='PatchEmbedDust3R', two_confs=True, desc_conf_mode=('exp', 0, inf), landscape_only=False)\n",
"\n",
"✓ MASt3R model loaded on cuda\n",
"\n",
"=== Running MASt3R Reconstruction ===\n",
"Initial memory state:\n",
"GPU Memory - Allocated: 2.58GB, Reserved: 2.69GB\n",
"CPU Memory Usage: 14.0%\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/content/mast3r/dust3r/dust3r/cloud_opt/base_opt.py:275: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.\n",
" @torch.cuda.amp.autocast(enabled=False)\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Processing 400 pairs...\n",
"Loading 240 images at 224x224...\n",
"\n",
"=== Loading images for MASt3R (size=224) ===\n",
">> Loading a list of 240 images\n",
" - adding /content/output/processed_images/30060098_13881136865_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/30060098_13881136865_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/30932426_9182415658_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/30932426_9182415658_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/31608163_6102133633_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/31608163_6102133633_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/32234104_183977071_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/32234104_183977071_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54689750_8177752931_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54689750_8177752931_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54789298_4426358141_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54789298_4426358141_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54924303_8694631531_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/54924303_8694631531_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/55042300_2998445423_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/55042300_2998445423_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56336675_12025095504_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56336675_12025095504_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56571846_8147517032_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56571846_8147517032_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56929508_8486048059_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/56929508_8486048059_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/57895262_5823807439_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/57895262_5823807439_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/57903036_6034663613_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/57903036_6034663613_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/58370062_228935435_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/58370062_228935435_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/60409409_9335730523_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/60409409_9335730523_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61195081_2862626518_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61195081_2862626518_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61353083_128372808_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61353083_128372808_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61442570_1877638298_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61442570_1877638298_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61931752_11269229804_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/61931752_11269229804_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/62109065_5110187734_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/62109065_5110187734_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63023054_7575192460_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63023054_7575192460_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63358653_3107448586_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63358653_3107448586_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63732276_3020022441_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63732276_3020022441_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63831138_11531850475_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63831138_11531850475_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63879656_8828566618_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/63879656_8828566618_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64133734_1372277262_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64133734_1372277262_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64177922_6939801959_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64177922_6939801959_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64512286_144258707_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64512286_144258707_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64752693_9379071376_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/64752693_9379071376_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65596895_2998348333_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65596895_2998348333_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65600629_2179631506_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65600629_2179631506_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65723931_2797767702_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/65723931_2797767702_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/66906958_589662361_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/66906958_589662361_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/67684501_389553533_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/67684501_389553533_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68173000_3055082929_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68173000_3055082929_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68388628_416361462_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68388628_416361462_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68664732_743450957_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/68664732_743450957_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69151734_8072413114_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69151734_8072413114_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69241373_2334905294_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69241373_2334905294_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69675366_3578017198_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/69675366_3578017198_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/70032246_6347641014_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/70032246_6347641014_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/70699652_8066487031_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/70699652_8066487031_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/71316394_5233978047_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/71316394_5233978047_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/71521166_8226626351_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/71521166_8226626351_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72075679_2232424648_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72075679_2232424648_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72598875_8072411042_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72598875_8072411042_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72646474_2231631573_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/72646474_2231631573_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/73543943_6819377449_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/73543943_6819377449_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74323184_6819378543_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74323184_6819378543_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74379252_3524899450_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74379252_3524899450_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74949128_744301420_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/74949128_744301420_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75556369_8486047615_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75556369_8486047615_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75670494_10532227934_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75670494_10532227934_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75795010_1073028_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75795010_1073028_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75963148_11531980813_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/75963148_11531980813_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76012163_5234572012_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76012163_5234572012_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76033783_4998492930_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76033783_4998492930_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76893682_2999450842_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/76893682_2999450842_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77082765_2334078741_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77082765_2334078741_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77322980_4097421297_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77322980_4097421297_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77502589_7155532159_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/77502589_7155532159_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/78461576_2179633616_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/78461576_2179633616_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/78756975_2797764270_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/78756975_2797764270_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80159334_3432556478_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80159334_3432556478_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80238669_11531890454_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80238669_11531890454_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80394863_159173947_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80394863_159173947_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80419518_5109586935_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80419518_5109586935_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80486775_7794448262_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80486775_7794448262_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80637823_2178834461_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/80637823_2178834461_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/82494139_2231488841_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/82494139_2231488841_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/82619588_2231634419_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/82619588_2231634419_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83049944_6012584465_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83049944_6012584465_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83295590_2999194388_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83295590_2999194388_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83393115_2713666377_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83393115_2713666377_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83494299_9338552580_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83494299_9338552580_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83683619_338844451_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83683619_338844451_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83880039_8704930508_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/83880039_8704930508_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/84280780_9149810125_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/84280780_9149810125_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/84416532_1372248960_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/84416532_1372248960_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/85875165_3423168615_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/85875165_3423168615_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87021942_9387960095_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87021942_9387960095_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87218542_4659693663_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87218542_4659693663_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87247686_240007777_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87247686_240007777_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87692684_217109210_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/87692684_217109210_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/88392746_217109207_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/88392746_217109207_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89270148_8703811409_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89270148_8703811409_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89428328_415853343_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89428328_415853343_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89821764_2714509360_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89821764_2714509360_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89912815_3055922954_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/89912815_3055922954_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90349736_2179635862_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90349736_2179635862_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90437703_2231631681_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90437703_2231631681_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90505934_1674425132_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90505934_1674425132_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90635649_2575304688_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90635649_2575304688_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90975523_4819480082_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/90975523_4819480082_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91086090_6251487936_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91086090_6251487936_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91147360_7119433063_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91147360_7119433063_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91223537_687114481_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91223537_687114481_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91887585_2717484563_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91887585_2717484563_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91966016_2575756133_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/91966016_2575756133_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/92092453_6346876777_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/92092453_6346876777_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/92332702_2575760403_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/92332702_2575760403_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93176024_7794453938_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93176024_7794453938_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93452424_2796919411_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93452424_2796919411_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93855352_2178846945_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/93855352_2178846945_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/94589793_5911133174_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/94589793_5911133174_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/94608068_9152036176_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/94608068_9152036176_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/95763587_2232280810_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/95763587_2232280810_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/95912681_1074872458_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/95912681_1074872458_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/96196686_8643079931_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/96196686_8643079931_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/96969581_4970715984_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/96969581_4970715984_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97044761_5284916914_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97044761_5284916914_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97169342_4819482004_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97169342_4819482004_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97408314_4660309480_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97408314_4660309480_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97679107_216044726_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/97679107_216044726_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98096144_7465571668_bottom.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98096144_7465571668_top.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98217251_4097423171_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98217251_4097423171_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98347882_247481604_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98347882_247481604_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98365344_176581376_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98365344_176581376_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98413296_389554202_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/98413296_389554202_right.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/99829338_590024774_left.jpg with resolution 512x512 --> 224x224\n",
" - adding /content/output/processed_images/99829338_590024774_right.jpg with resolution 512x512 --> 224x224\n",
" (Found 240 images)\n",
"Loaded 240 images\n",
"After loading images:\n",
"GPU Memory - Allocated: 2.58GB, Reserved: 2.69GB\n",
"CPU Memory Usage: 14.0%\n",
"Creating 400 image pairs...\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"Preparing pairs: 100%|██████████| 400/400 [00:00<00:00, 983424.15it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Running MASt3R inference on 400 pairs...\n",
">> Inference with model on 400 image pairs\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
" 0%| | 0/400 [00:00, ?it/s]/content/mast3r/dust3r/dust3r/inference.py:44: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.\n",
" with torch.cuda.amp.autocast(enabled=bool(use_amp)):\n",
"/content/mast3r/dust3r/dust3r/model.py:206: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.\n",
" with torch.cuda.amp.autocast(enabled=False):\n",
"/content/mast3r/dust3r/dust3r/inference.py:48: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.\n",
" with torch.cuda.amp.autocast(enabled=False):\n",
"100%|██████████| 400/400 [01:29<00:00, 4.47it/s]\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"✓ MASt3R inference complete\n",
"After inference:\n",
"GPU Memory - Allocated: 2.58GB, Reserved: 2.69GB\n",
"CPU Memory Usage: 23.4%\n",
"Running global alignment...\n",
"Computing global alignment...\n",
" init edge (176*,177*) score=np.float64(198.191650390625)\n",
" init edge (177,220*) score=np.float64(126.82020568847656)\n",
" init edge (177,200*) score=np.float64(98.59686279296875)\n",
" init edge (177,234*) score=np.float64(75.69866943359375)\n",
" init edge (130*,234) score=np.float64(67.14945983886719)\n",
" init edge (21*,200) score=np.float64(53.217987060546875)\n",
" init edge (21,68*) score=np.float64(42.70748519897461)\n",
" init edge (21,180*) score=np.float64(41.27654266357422)\n",
" init edge (176,224*) score=np.float64(37.70079040527344)\n",
" init edge (107*,234) score=np.float64(37.45484924316406)\n",
" init edge (177,188*) score=np.float64(35.783748626708984)\n",
" init edge (112*,200) score=np.float64(34.99172592163086)\n",
" init edge (21,117*) score=np.float64(34.591163635253906)\n",
" init edge (109*,117) score=np.float64(33.78559875488281)\n",
" init edge (68,119*) score=np.float64(31.736557006835938)\n",
" init edge (176,225*) score=np.float64(29.310312271118164)\n",
" init edge (107,116*) score=np.float64(28.306058883666992)\n",
" init edge (117,148*) score=np.float64(23.644939422607422)\n",
" init edge (116,124*) score=np.float64(22.048015594482422)\n",
" init edge (31*,234) score=np.float64(21.263404846191406)\n",
" init edge (59*,117) score=np.float64(21.03856086730957)\n",
" init edge (15*,109) score=np.float64(20.187294006347656)\n",
" init edge (39*,224) score=np.float64(19.454084396362305)\n",
" init edge (30*,224) score=np.float64(19.337472915649414)\n",
" init edge (119,181*) score=np.float64(18.82221794128418)\n",
" init edge (119,127*) score=np.float64(17.78961181640625)\n",
" init edge (103*,181) score=np.float64(16.832151412963867)\n",
" init edge (13*,107) score=np.float64(16.34041404724121)\n",
" init edge (117,175*) score=np.float64(15.928190231323242)\n",
" init edge (103,155*) score=np.float64(15.851051330566406)\n",
" init edge (106*,107) score=np.float64(15.327048301696777)\n",
" init edge (33*,103) score=np.float64(13.004490852355957)\n",
" init edge (33,143*) score=np.float64(12.611233711242676)\n",
" init edge (161*,180) score=np.float64(12.094330787658691)\n",
" init edge (44*,225) score=np.float64(11.83602237701416)\n",
" init edge (44,174*) score=np.float64(10.263052940368652)\n",
" init edge (35*,119) score=np.float64(8.20073413848877)\n",
" init edge (31,47*) score=np.float64(7.8514580726623535)\n",
" init edge (148,219*) score=np.float64(4.8152337074279785)\n",
" init edge (161,218*) score=np.float64(4.776149749755859)\n",
" init edge (17*,124) score=np.float64(4.438667297363281)\n",
" init edge (108*,109) score=np.float64(4.4119791984558105)\n",
" init edge (108,201*) score=np.float64(3.5564422607421875)\n",
" init edge (143,199*) score=np.float64(1.984175205230713)\n",
" init edge (68,142*) score=np.float64(105.67889404296875)\n",
" init edge (78*,112) score=np.float64(87.02381134033203)\n",
" init edge (68,190*) score=np.float64(75.10292053222656)\n",
" init edge (14*,142) score=np.float64(42.90108108520508)\n",
" init edge (116,136*) score=np.float64(40.12834167480469)\n",
" init edge (112,160*) score=np.float64(37.66036605834961)\n",
" init edge (93*,116) score=np.float64(31.408729553222656)\n",
" init edge (81*,136) score=np.float64(21.372879028320312)\n",
" init edge (81,221*) score=np.float64(17.092073440551758)\n",
" init edge (161,191*) score=np.float64(13.261397361755371)\n",
" init edge (136,205*) score=np.float64(13.253068923950195)\n",
" init edge (189*,191) score=np.float64(10.710558891296387)\n",
" init edge (149*,190) score=np.float64(9.517009735107422)\n",
" init edge (69*,221) score=np.float64(8.752819061279297)\n",
" init edge (45*,189) score=np.float64(8.266498565673828)\n",
" init edge (45,153*) score=np.float64(3.15584135055542)\n",
" init edge (154*,160) score=np.float64(51.928775787353516)\n",
" init edge (93,235*) score=np.float64(37.453861236572266)\n",
" init edge (6*,235) score=np.float64(30.59404182434082)\n",
" init edge (49*,154) score=np.float64(30.57103157043457)\n",
" init edge (57*,189) score=np.float64(13.715526580810547)\n",
" init edge (69,73*) score=np.float64(10.64309024810791)\n",
" init edge (12*,235) score=np.float64(8.873993873596191)\n",
" init edge (12,204*) score=np.float64(5.679068088531494)\n",
" init edge (156*,235) score=np.float64(64.09850311279297)\n",
" init edge (32*,156) score=np.float64(35.82743453979492)\n",
" init edge (32,36*) score=np.float64(25.17760467529297)\n",
" init edge (8*,36) score=np.float64(15.532574653625488)\n",
" init edge (156,157*) score=np.float64(93.43229675292969)\n",
" init edge (60*,156) score=np.float64(77.3466567993164)\n",
" init edge (131*,156) score=np.float64(70.33899688720703)\n",
" init edge (32,72*) score=np.float64(54.28638458251953)\n",
" init edge (32,102*) score=np.float64(46.04034423828125)\n",
" init edge (51*,102) score=np.float64(31.41990089416504)\n",
" init edge (51,56*) score=np.float64(21.61564064025879)\n",
" init edge (8,20*) score=np.float64(16.26292610168457)\n",
" init edge (51,113*) score=np.float64(14.79775333404541)\n",
" init edge (20,58*) score=np.float64(13.503860473632812)\n",
" init edge (20,192*) score=np.float64(13.007828712463379)\n",
" init edge (51,71*) score=np.float64(9.605389595031738)\n",
" init edge (51,70*) score=np.float64(9.05337905883789)\n",
" init edge (79*,157) score=np.float64(129.6910858154297)\n",
" init edge (20,48*) score=np.float64(56.87898254394531)\n",
" init edge (50*,51) score=np.float64(39.842803955078125)\n",
" init edge (61*,79) score=np.float64(33.298465728759766)\n",
" init edge (77*,79) score=np.float64(32.067073822021484)\n",
" init edge (48,152*) score=np.float64(28.163787841796875)\n",
" init edge (61,92*) score=np.float64(25.451204299926758)\n",
" init edge (137*,152) score=np.float64(17.217470169067383)\n",
" init edge (61,126*) score=np.float64(15.625884056091309)\n",
" init edge (34*,61) score=np.float64(12.552777290344238)\n",
" init edge (61,118*) score=np.float64(11.2539701461792)\n",
" init edge (37*,152) score=np.float64(8.995638847351074)\n",
" init edge (9*,152) score=np.float64(8.606120109558105)\n",
" init edge (80*,92) score=np.float64(33.94401931762695)\n",
" init edge (80,198*) score=np.float64(27.786998748779297)\n",
" init edge (105*,126) score=np.float64(24.290023803710938)\n",
" init edge (80,193*) score=np.float64(13.248384475708008)\n",
" init edge (0*,105) score=np.float64(2.6756503582000732)\n",
" init edge (101*,105) score=np.float64(25.465564727783203)\n",
" init edge (101,135*) score=np.float64(24.68191146850586)\n",
" init edge (0,186*) score=np.float64(12.253896713256836)\n",
" init edge (101,223*) score=np.float64(11.734528541564941)\n",
" init edge (1*,186) score=np.float64(9.884940147399902)\n",
" init edge (1,96*) score=np.float64(2.507599115371704)\n",
" init edge (186,187*) score=np.float64(2.3481709957122803)\n",
" init edge (1,76*) score=np.float64(2.085859537124634)\n",
" init edge (76,125*) score=np.float64(1.9163832664489746)\n",
" init edge (96,139*) score=np.float64(30.386951446533203)\n",
" init edge (96,110*) score=np.float64(26.716379165649414)\n",
" init edge (139,165*) score=np.float64(21.06761360168457)\n",
" init edge (11*,165) score=np.float64(20.40703582763672)\n",
" init edge (96,237*) score=np.float64(20.272802352905273)\n",
" init edge (97*,165) score=np.float64(16.869216918945312)\n",
" init edge (95*,223) score=np.float64(12.67619514465332)\n",
" init edge (52*,96) score=np.float64(11.278505325317383)\n",
" init edge (133*,237) score=np.float64(8.637186050415039)\n",
" init edge (38*,237) score=np.float64(6.428195476531982)\n",
" init edge (133,233*) score=np.float64(5.470247268676758)\n",
" init edge (164*,165) score=np.float64(5.076940059661865)\n",
" init edge (75*,164) score=np.float64(4.356322288513184)\n",
" init edge (29*,233) score=np.float64(3.3237662315368652)\n",
" init edge (5*,125) score=np.float64(2.766550064086914)\n",
" init edge (4*,125) score=np.float64(1.9264378547668457)\n",
" init edge (11,53*) score=np.float64(49.043006896972656)\n",
" init edge (10*,53) score=np.float64(34.30419158935547)\n",
" init edge (65*,237) score=np.float64(26.386917114257812)\n",
" init edge (237,238*) score=np.float64(23.09255027770996)\n",
" init edge (52,239*) score=np.float64(22.325103759765625)\n",
" init edge (16*,238) score=np.float64(14.995553970336914)\n",
" init edge (10,150*) score=np.float64(10.147618293762207)\n",
" init edge (111*,238) score=np.float64(6.990636825561523)\n",
" init edge (22*,150) score=np.float64(4.147487640380859)\n",
" init edge (104*,111) score=np.float64(19.85179901123047)\n",
" init edge (150,162*) score=np.float64(10.878657341003418)\n",
" init edge (140*,162) score=np.float64(4.328245639801025)\n",
" init edge (88*,140) score=np.float64(3.2645134925842285)\n",
" init edge (88,138*) score=np.float64(2.872014045715332)\n",
" init edge (100*,138) score=np.float64(30.533662796020508)\n",
" init edge (88,123*) score=np.float64(26.439573287963867)\n",
" init edge (43*,162) score=np.float64(19.79646873474121)\n",
" init edge (88,141*) score=np.float64(5.435484409332275)\n",
" init edge (43,99*) score=np.float64(33.13941955566406)\n",
" init edge (99,231*) score=np.float64(32.082481384277344)\n",
" init edge (43,172*) score=np.float64(30.933401107788086)\n",
" init edge (27*,99) score=np.float64(22.771194458007812)\n",
" init edge (27,87*) score=np.float64(10.721604347229004)\n",
" init edge (172,195*) score=np.float64(141.93589782714844)\n",
" init edge (42*,172) score=np.float64(130.3939666748047)\n",
" init edge (18*,172) score=np.float64(104.83585357666016)\n",
" init edge (42,85*) score=np.float64(69.16996002197266)\n",
" init edge (82*,231) score=np.float64(48.20613479614258)\n",
" init edge (42,67*) score=np.float64(41.362735748291016)\n",
" init edge (19*,172) score=np.float64(39.75721740722656)\n",
" init edge (173*,231) score=np.float64(38.7330207824707)\n",
" init edge (19,163*) score=np.float64(36.17812728881836)\n",
" init edge (173,215*) score=np.float64(35.999629974365234)\n",
" init edge (85,98*) score=np.float64(34.837520599365234)\n",
" init edge (145*,172) score=np.float64(33.43960189819336)\n",
" init edge (63*,163) score=np.float64(31.814668655395508)\n",
" init edge (24*,67) score=np.float64(30.312519073486328)\n",
" init edge (67,236*) score=np.float64(28.61271858215332)\n",
" init edge (67,86*) score=np.float64(20.757091522216797)\n",
" init edge (159*,236) score=np.float64(20.601287841796875)\n",
" init edge (3*,67) score=np.float64(20.254379272460938)\n",
" init edge (167*,236) score=np.float64(18.324573516845703)\n",
" init edge (26*,67) score=np.float64(14.904739379882812)\n",
" init edge (84*,163) score=np.float64(14.214141845703125)\n",
" init edge (3,122*) score=np.float64(13.858685493469238)\n",
" init edge (2*,3) score=np.float64(13.420378684997559)\n",
" init edge (210*,236) score=np.float64(12.156282424926758)\n",
" init edge (202*,210) score=np.float64(9.673087120056152)\n",
" init edge (173,185*) score=np.float64(7.689498424530029)\n",
" init edge (54*,98) score=np.float64(6.114027500152588)\n",
" init edge (82,94*) score=np.float64(4.246077537536621)\n",
" init edge (115*,185) score=np.float64(3.62151837348938)\n",
" init edge (23*,115) score=np.float64(3.403630256652832)\n",
" init edge (23,208*) score=np.float64(3.3950142860412598)\n",
" init edge (82,121*) score=np.float64(2.706270456314087)\n",
" init edge (82,120*) score=np.float64(2.706270456314087)\n",
" init edge (55*,202) score=np.float64(2.398193836212158)\n",
" init edge (18,144*) score=np.float64(123.50166320800781)\n",
" init edge (67,194*) score=np.float64(60.72038650512695)\n",
" init edge (67,230*) score=np.float64(50.011924743652344)\n",
" init edge (24,66*) score=np.float64(44.04308319091797)\n",
" init edge (144,196*) score=np.float64(42.425254821777344)\n",
" init edge (128*,194) score=np.float64(37.86113739013672)\n",
" init edge (25*,66) score=np.float64(35.42013168334961)\n",
" init edge (146*,196) score=np.float64(22.455894470214844)\n",
" init edge (196,197*) score=np.float64(20.902019500732422)\n",
" init edge (178*,197) score=np.float64(20.26895523071289)\n",
" init edge (171*,196) score=np.float64(19.984004974365234)\n",
" init edge (182*,230) score=np.float64(18.07193374633789)\n",
" init edge (210,232*) score=np.float64(16.72238540649414)\n",
" init edge (64*,66) score=np.float64(10.264533996582031)\n",
" init edge (54,114*) score=np.float64(8.20957088470459)\n",
" init edge (169*,232) score=np.float64(6.27802848815918)\n",
" init edge (132*,178) score=np.float64(6.248705863952637)\n",
" init edge (55,168*) score=np.float64(5.890901565551758)\n",
" init edge (207*,232) score=np.float64(4.692310333251953)\n",
" init edge (115,206*) score=np.float64(3.7259089946746826)\n",
" init edge (207,209*) score=np.float64(2.5614492893218994)\n",
" init edge (28*,169) score=np.float64(2.523918390274048)\n",
" init edge (128,129*) score=np.float64(2.44639253616333)\n",
" init edge (46*,129) score=np.float64(1.188760757446289)\n",
" init edge (158*,230) score=np.float64(62.301204681396484)\n",
" init edge (62*,196) score=np.float64(57.28425216674805)\n",
" init edge (182,183*) score=np.float64(55.23586654663086)\n",
" init edge (158,170*) score=np.float64(45.76015090942383)\n",
" init edge (62,147*) score=np.float64(29.319347381591797)\n",
" init edge (64,212*) score=np.float64(15.65982723236084)\n",
" init edge (83*,158) score=np.float64(13.951066970825195)\n",
" init edge (166*,169) score=np.float64(6.895370960235596)\n",
" init edge (212,213*) score=np.float64(6.071690559387207)\n",
" init edge (40*,212) score=np.float64(4.974913597106934)\n",
" init edge (74*,213) score=np.float64(3.446519136428833)\n",
" init edge (91*,212) score=np.float64(3.2521183490753174)\n",
" init edge (90*,213) score=np.float64(3.1409637928009033)\n",
" init edge (129,211*) score=np.float64(2.924590587615967)\n",
" init edge (129,222*) score=np.float64(2.5633556842803955)\n",
" init edge (166,226*) score=np.float64(39.13412094116211)\n",
" init edge (40,214*) score=np.float64(21.58083152770996)\n",
" init edge (226,227*) score=np.float64(16.252544403076172)\n",
" init edge (151*,214) score=np.float64(6.387537002563477)\n",
" init edge (184*,214) score=np.float64(6.145638465881348)\n",
" init edge (74,89*) score=np.float64(5.847555160522461)\n",
" init edge (184,217*) score=np.float64(4.346708297729492)\n",
" init edge (74,179*) score=np.float64(4.109639644622803)\n",
" init edge (7*,226) score=np.float64(3.182105541229248)\n",
" init edge (134*,226) score=np.float64(3.057368278503418)\n",
" init edge (203*,226) score=np.float64(1.9449245929718018)\n",
" init edge (216*,217) score=np.float64(17.116296768188477)\n",
" init edge (41*,89) score=np.float64(12.121138572692871)\n"
]
},
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/tmp/ipython-input-3573557210.py\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mOUTPUT_DIR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/content/output\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m gs_output = main_pipeline(\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mimage_dir\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mIMAGE_DIR\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0moutput_dir\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mOUTPUT_DIR\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/tmp/ipython-input-1324562647.py\u001b[0m in \u001b[0;36mmain_pipeline\u001b[0;34m(image_dir, output_dir, square_size, iterations, max_images, max_pairs, max_points)\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mload_mast3r_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 96\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 97\u001b[0;31m scene, mast3r_images = run_mast3r_pairs(\n\u001b[0m\u001b[1;32m 98\u001b[0m \u001b[0mmodel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mimage_paths\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpairs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 99\u001b[0m \u001b[0mmax_pairs\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mNone\u001b[0m \u001b[0;31m# Already limited in get_image_pairs_dino\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/tmp/ipython-input-3263070863.py\u001b[0m in \u001b[0;36mrun_mast3r_pairs\u001b[0;34m(model, image_paths, pairs, device, batch_size, max_pairs)\u001b[0m\n\u001b[1;32m 507\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 508\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Computing global alignment...\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 509\u001b[0;31m loss = scene.compute_global_alignment(\n\u001b[0m\u001b[1;32m 510\u001b[0m \u001b[0minit\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"mst\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 511\u001b[0m \u001b[0mniter\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m150\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# Reduced from 300\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/amp/autocast_mode.py\u001b[0m in \u001b[0;36mdecorate_autocast\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 42\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdecorate_autocast\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 43\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mautocast_instance\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 44\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 45\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 46\u001b[0m decorate_autocast.__script_unsupported = ( # type: ignore[attr-defined]\n",
"\u001b[0;32m/content/mast3r/dust3r/dust3r/cloud_opt/base_opt.py\u001b[0m in \u001b[0;36mcompute_global_alignment\u001b[0;34m(self, init, niter_PnP, **kw)\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[0;32mpass\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 279\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0minit\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'msp'\u001b[0m \u001b[0;32mor\u001b[0m \u001b[0minit\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'mst'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 280\u001b[0;31m \u001b[0minit_fun\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minit_minimum_spanning_tree\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mniter_PnP\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mniter_PnP\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 281\u001b[0m \u001b[0;32melif\u001b[0m \u001b[0minit\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'known_poses'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 282\u001b[0m init_fun.init_from_known_poses(self, min_conf_thr=self.min_conf_thr,\n",
"\u001b[0;32m/usr/local/lib/python3.12/dist-packages/torch/utils/_contextlib.py\u001b[0m in \u001b[0;36mdecorate_context\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 118\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0mdecorate_context\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 119\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mctx_factory\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 120\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 121\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 122\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mdecorate_context\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/content/mast3r/dust3r/dust3r/cloud_opt/init_im_poses.py\u001b[0m in \u001b[0;36minit_minimum_spanning_tree\u001b[0;34m(self, **kw)\u001b[0m\n\u001b[1;32m 70\u001b[0m \"\"\"\n\u001b[1;32m 71\u001b[0m \u001b[0mdevice\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdevice\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 72\u001b[0;31m pts3d, _, im_focals, im_poses = minimum_spanning_tree(self.imshapes, self.edges,\n\u001b[0m\u001b[1;32m 73\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpred_i\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpred_j\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconf_i\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mconf_j\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mim_conf\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmin_conf_thr\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 74\u001b[0m \u001b[0mdevice\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mhas_im_poses\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mhas_im_poses\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mverbose\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mverbose\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/content/mast3r/dust3r/dust3r/cloud_opt/init_im_poses.py\u001b[0m in \u001b[0;36mminimum_spanning_tree\u001b[0;34m(imshapes, edges, pred_i, pred_j, conf_i, conf_j, im_conf, min_conf_thr, device, has_im_poses, niter_PnP, verbose)\u001b[0m\n\u001b[1;32m 185\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 186\u001b[0m \u001b[0;31m# let's try again later\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 187\u001b[0;31m \u001b[0mtodo\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0minsert\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mscore\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mi\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mj\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 188\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 189\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mhas_im_poses\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"source": [
"if __name__ == \"__main__\":\n",
" IMAGE_DIR = \"/content/drive/MyDrive/your_folder/grand_place\"\n",
" OUTPUT_DIR = \"/content/output\"\n",
"\n",
" gs_output = main_pipeline(\n",
" image_dir=IMAGE_DIR,\n",
" output_dir=OUTPUT_DIR,\n",
" square_size=512, #1024\n",
" iterations=1000, #4000\n",
" max_images=None,\n",
" max_pairs=400, #1000 max for system ram\n",
" max_points=1000 #100000 max\n",
" )\n",
"\n",
" print(f\"\\n{'='*70}\")\n",
" print(\"Pipeline completed successfully!\")\n",
" print(f\"{'='*70}\")\n",
" print(f\"Gaussian Splatting output: {gs_output}\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "vepP2qukQSfO"
},
"source": [
" # AC\n",
" gs_output = main_pipeline(\n",
" image_dir=IMAGE_DIR,\n",
" output_dir=OUTPUT_DIR,\n",
" square_size=1024,\n",
" iterations=4000, \n",
" max_images=None,\n",
" max_pairs=1000, \n",
" max_points=800000 \n",
" )\n",
" "
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "jy6xMSrZQSfP"
},
"source": [
" # MLE\n",
" gs_output = main_pipeline(\n",
" image_dir=IMAGE_DIR,\n",
" output_dir=OUTPUT_DIR,\n",
" square_size=1024,\n",
" iterations=4000, \n",
" max_images=None,\n",
" max_pairs=1200, \n",
" max_points=800000 \n",
" ) "
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SICSrOA7QSfP"
},
"source": []
},
{
"cell_type": "markdown",
"metadata": {
"id": "ZKOn3Dm1QSfP"
},
"source": [
"# **END**"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "NolOSeszQSfP"
},
"source": [
"### **3D Gaussian Splat Viewer**\n",
"\n",
"https://splat-three.vercel.app/?url=sagrada2_photo.splat"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "VQsLeKY8Rl8Y"
},
"outputs": [],
"source": []
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"gpuType": "T4",
"machine_shape": "hm",
"provenance": []
},
"kaggle": {
"accelerator": "nvidiaTeslaT4",
"dataSources": [
{
"databundleVersionId": 3445386,
"sourceId": 34970,
"sourceType": "competition"
}
],
"dockerImageVersionId": 31236,
"isGpuEnabled": true,
"isInternetEnabled": true,
"language": "python",
"sourceType": "notebook"
},
"kernelspec": {
"display_name": "Python 3",
"name": "python3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"084cc3b7c4b54d8e85675c82f2d69565": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"10003a3c3e474babb416a393569aec43": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"1e5f1e24aff34f5d9f495a6e18202362": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_87f09bf010d24d85b6d1dc4aac7b9f02",
"IPY_MODEL_8d3373142a12430aa3e762a70dcc30f4",
"IPY_MODEL_6f739e161bbf4c1bb74c4e450fb25335"
],
"layout": "IPY_MODEL_d735b4443f9b43faa7dd9036d05449d6"
}
},
"21a9dc812dc545d8bf399317c742f53f": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"293756b1586744079ce0cd5f63d24b7b": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"3a13744929ca41fb82ab0f659106d58e": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"3b17bfa9844446f9a7433232bf86c05f": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"4056583d511245119273d7175acc9ad3": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"422dd0806162460f9a86ae5fed7a020b": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"4b37615c58fc49fca937aeeafdd64a03": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"527dfa8fbbfc4bcfa758204415665e27": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"56c4d394433042ddb623ce1bc8d1fcbc": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_ded19df53c3146f998f171886c09e01d",
"IPY_MODEL_f5b94d4b0a5e4aa5b5c19da0c8da7640",
"IPY_MODEL_e285e0404c2144aa9d07b441c08f27c6"
],
"layout": "IPY_MODEL_4b37615c58fc49fca937aeeafdd64a03"
}
},
"5a787fde581b4b53858314f41f9d3e5a": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_d7e3b503e7c24f1f8290366f354e54fc",
"IPY_MODEL_838308596d3b41919e7e89b8e136aeb0",
"IPY_MODEL_63bb65b77d114c9bb9c3cca3c6e19e31"
],
"layout": "IPY_MODEL_293756b1586744079ce0cd5f63d24b7b"
}
},
"6050a334e28248fe8c4e3c2bbe71ba34": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"63bb65b77d114c9bb9c3cca3c6e19e31": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_21a9dc812dc545d8bf399317c742f53f",
"placeholder": "",
"style": "IPY_MODEL_6a5f159e804e4b3685a3f84e6ab40231",
"value": " 548/548 [00:00<00:00, 72.0kB/s]"
}
},
"64c215802af240d1bc4b5b4df02238a4": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"6a5f159e804e4b3685a3f84e6ab40231": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"6f739e161bbf4c1bb74c4e450fb25335": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e07f84b2794b4e008a86c7f35bce8e1f",
"placeholder": "",
"style": "IPY_MODEL_f6dca76516144c5b8f8123fdfb09cf80",
"value": " 346M/346M [00:02<00:00, 236MB/s]"
}
},
"7c341652d3b24622ad0d2de52988f259": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"838308596d3b41919e7e89b8e136aeb0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_7c341652d3b24622ad0d2de52988f259",
"max": 548,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_084cc3b7c4b54d8e85675c82f2d69565",
"value": 548
}
},
"87f09bf010d24d85b6d1dc4aac7b9f02": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_422dd0806162460f9a86ae5fed7a020b",
"placeholder": "",
"style": "IPY_MODEL_963b342842a1461f8e7309e62251b674",
"value": "model.safetensors: 100%"
}
},
"8d3373142a12430aa3e762a70dcc30f4": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_527dfa8fbbfc4bcfa758204415665e27",
"max": 346345912,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_4056583d511245119273d7175acc9ad3",
"value": 346345912
}
},
"963b342842a1461f8e7309e62251b674": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"b9124a12e2854d0187b35969edfeaec7": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"cb85c5bb008c4c2d9caedb86b3b09688": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d735b4443f9b43faa7dd9036d05449d6": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d7e3b503e7c24f1f8290366f354e54fc": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_10003a3c3e474babb416a393569aec43",
"placeholder": "",
"style": "IPY_MODEL_b9124a12e2854d0187b35969edfeaec7",
"value": "config.json: 100%"
}
},
"ded19df53c3146f998f171886c09e01d": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_3a13744929ca41fb82ab0f659106d58e",
"placeholder": "",
"style": "IPY_MODEL_3b17bfa9844446f9a7433232bf86c05f",
"value": "preprocessor_config.json: 100%"
}
},
"e07f84b2794b4e008a86c7f35bce8e1f": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e285e0404c2144aa9d07b441c08f27c6": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_f98b4ae9a1d849539a0be9a88d5ba59c",
"placeholder": "",
"style": "IPY_MODEL_6050a334e28248fe8c4e3c2bbe71ba34",
"value": " 436/436 [00:00<00:00, 50.7kB/s]"
}
},
"f5b94d4b0a5e4aa5b5c19da0c8da7640": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_cb85c5bb008c4c2d9caedb86b3b09688",
"max": 436,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_64c215802af240d1bc4b5b4df02238a4",
"value": 436
}
},
"f6dca76516144c5b8f8123fdfb09cf80": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"f98b4ae9a1d849539a0be9a88d5ba59c": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
}
}
}
},
"nbformat": 4,
"nbformat_minor": 0
} |