{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"# **cp311 to cp312 explained**","metadata":{}},{"cell_type":"markdown","source":"## cp311\nhttps://www.kaggle.com/code/stpeteishii/mb-ongmx20-25-mast3r-sfm-imc2025-ong-sub-is\n\n## cp312\nhttps://www.kaggle.com/code/stpeteishii/ongmx20-25-mast3r-sfm-imc2025-ong-sub-is-t","metadata":{}},{"cell_type":"code","source":"","metadata":{"trusted":true},"outputs":[],"execution_count":null},{"cell_type":"markdown","source":"Here is a structured summary of all changes introduced in the cp312 version compared to cp311:\n\n---\n\n## Changes from cp311 → cp312\n\n### 1. Python & Wheel Compatibility\n\n- **pycolmap upgraded**: The cp311 wheel (`pycolmap-3.11.1-cp311`) is replaced with `pycolmap-4.0.3-cp312`, sourced from a user notebook dataset (`stpeteishii/pycolmap-4-0-3-cp312`).\n- All MASt3R-related wheels and paths are now loaded from `/kaggle/input/notebooks/stpeteishii/mast3r-cp312/` instead of `/kaggle/input/mast3r-fix/`.\n- `print(sys.version)` is added early on to explicitly verify the Python version.\n\n### 2. FAISS Installation\n\n- cp312 adds three explicit wheel installs for FAISS and its CUDA dependencies (`faiss_gpu_cu12`, `nvidia_cublas_cu12`, `nvidia_cuda_runtime_cu12`) from a dedicated dataset — replacing the single `faiss-gpu-cu12` install used in cp311.\n\n### 3. `import_into_colmap` — Full Rewrite\n\n- cp311 relied on the external `import_into_colmap` function from `h5_to_db`.\n- cp312 **rewrites this function from scratch** using raw `sqlite3`, manually creating the COLMAP database schema and inserting cameras, images, keypoints, and matches. This was necessary because the pycolmap 4.0.3 `Database` API changed significantly.\n- Debug introspection of `pycolmap.Database` methods (`db.write_camera.__doc__`, etc.) is also added.\n\n### 4. pycolmap API Breaking Change — `cam_from_world`\n\n- In `reconstruct_from_db`, cp311 accesses `image.cam_from_world.rotation` (attribute).\n- cp312 changes this to `image.cam_from_world().rotation` (method call), adapting to the breaking API change in pycolmap 4.0.3.\n\n### 5. ASMK `.so` Loading for cp312\n\n- cp312 adds explicit manual loading of compiled C-extension `.so` files (`hamming.cpython-312-x86_64-linux-gnu.so`) using `importlib.util.spec_from_file_location`, since ASMK's compiled extensions are Python-version-specific.\n\n### 6. ASMK / FAISS Monkey-Patches\n\n- **`FaissGpuL2Index` patch**: `asmk_index.FaissGpuL2Index.create_index` is monkey-patched to use a CPU `IndexFlatL2` index instead, as a compatibility workaround.\n- **`Codebook.quantize` patch**: A `_fixed_quantize` function is added and monkey-patched onto `asmk_codebook.Codebook.quantize`. It rebuilds the FAISS index on demand and fixes argument-count mismatches between `build_ivf` (3 args) and `query_ivf` (2 args) paths.\n\n### 7. Model Loading — `torch.serialization` Fix\n\n- cp312 adds `torch.serialization.add_safe_globals([argparse.Namespace])` before calling `load_model`, to satisfy PyTorch's stricter safe-deserialization requirements introduced in newer versions.\n\n### 8. Robustness Improvements in `run_one_dataset`\n\n- A guard is added: if `indexed_pairs` is empty after shortlisting, the dataset is skipped gracefully with a clear log message (instead of potentially crashing).\n- The `except` block now also calls `traceback.print_exc()` for more informative error reporting.\n\n### 9. `reconstruct_from_db` — Verbose Logging\n\n- cp312 adds a `log()` helper with `sys.stdout.flush()` and step-by-step progress messages throughout `reconstruct_from_db`, making it easier to diagnose where failures occur.\n\n### 10. Thread Pool — `max_workers` Reduced\n\n- `ThreadPoolExecutor` in `run_mast3r_pipeline` is changed from `max_workers=2` (cp311) to `max_workers=1` (cp312), likely to reduce memory pressure or avoid race conditions under the new setup.\n\n### 11. Dataset & Input Paths\n\n- `data_dir` is changed from `/kaggle/input/image-matching-challenge-2025` to `/kaggle/input/competitions/image-matching-challenge-2025`.\n- The `sys.path` entry for imc-utils is updated from `/kaggle/input/pycolmap3-11-imc-utils` to `/kaggle/input/datasets/yuanlin08/pycolmap3-11-imc-utils`.\n- Metric CSV paths in the scoring block are updated accordingly.\n\n---\n\n**Summary**: The cp312 migration is primarily driven by upgrading pycolmap from 3.11.1 → 4.0.3 (which has breaking API changes), adapting ASMK's compiled extensions and FAISS integration for Python 3.12, and fixing torch deserialization. Alongside these compatibility fixes, several robustness and observability improvements (error handling, logging, empty-pair guard) were also introduced.","metadata":{}},{"cell_type":"markdown","source":"Here is a detailed analysis of the full conversion pipeline from MASt3R outputs to COLMAP format, and exactly where cp311 and cp312 agree or differ.\n\n---\n\n## Overview of the Pipeline\n\nThe conversion consists of **six sequential stages**:\n\n```\nMASt3R inference\n ↓\n [1] extract_correspondences_nonsym → raw pixel matches\n ↓\n [2] transform_keypoints_to_original → coords in original image space\n ↓\n [3] unify_keypoints_and_matches → global keypoint IDs\n ↓\n [4] save_unified_keypoints_and_matches → keypoints.h5 / matches.h5 / pairs.txt\n ↓\n [5] import_into_colmap → COLMAP SQLite database\n ↓\n [6] verify_matches + incremental_mapping → reconstructed poses\n```\n\n---\n\n## Stage-by-Stage Breakdown\n\n### Stage 1 — MASt3R Inference & Correspondence Extraction (`match_with_mast3r_and_save`)\n\nFor each image pair:\n1. `load_images()` resizes both images to 512px (DUST3R convention).\n2. `inference()` runs the MASt3R encoder-decoder to produce dense descriptor maps (`desc`) and confidence maps (`desc_conf`) for both views.\n3. `extract_correspondences_nonsym()` computes non-symmetric nearest-neighbor correspondences in descriptor space, returning matched pixel coordinates `(x, y)` in the **resized/cropped** image space, plus a per-match confidence score.\n4. Matches below `CONFIG.MATCH_CONF_TH = 1.001` are discarded, and a 3-pixel border exclusion mask is applied.\n\n**→ Identical in cp311 and cp312.**\n\n---\n\n### Stage 2 — Coordinate Back-Projection (`transform_keypoints_to_original`)\n\nBecause `load_images()` resizes and center-crops the image before feeding it to MASt3R, the match coordinates are in the **processed image space**, not the original. This function reverses both the crop offset and the scale factor to recover coordinates in the original image's pixel space.\n\nThe math:\n- Recomputes the resize scale factor (long-side → 512).\n- Recomputes the crop offsets (`halfw`, `halfh`, aligned to 16-pixel grid).\n- Adds crop offsets back, then divides by scale factor.\n\n**→ Identical in cp311 and cp312.**\n\n---\n\n### Stage 3 — Keypoint Unification (`unify_keypoints_and_matches`)\n\nSince each image appears in multiple pairs, the same physical point on an image may appear under slightly different floating-point coordinates from different pair runs. This stage:\n1. Collects all coordinates for each image across all pairs.\n2. Rounds them to 1 decimal place and takes `np.unique` to deduplicate.\n3. Assigns each unique coordinate a **global integer ID**.\n4. Converts every pair's coordinate-based match `(x1,y1,x2,y2)` into a global ID pair `(id1, id2)` via a coordinate→ID lookup table.\n\nThis produces `global_keypoints[img]` and `global_matches[(img1, img2)]` which are the COLMAP-compatible data structures.\n\n**→ Identical in cp311 and cp312.**\n\n---\n\n### Stage 4 — HDF5 Serialization (`save_unified_keypoints_and_matches`)\n\nWrites three files to `feature_dir`:\n- `keypoints.h5` — per-image `(N, 2)` coordinate arrays.\n- `matches.h5` — per-pair `(M, 2)` global ID arrays (only pairs with ≥ `MAST3R_MIN_PAIR = 15` matches are written).\n- `pairs.txt` — list of image name pairs, used as input to `verify_matches`.\n\n**→ Identical in cp311 and cp312.**\n\n---\n\n### Stage 5 — COLMAP Database Import (`import_into_colmap`) ⚠️ **DIFFERS**\n\nThis is the only stage with a **fundamental architectural difference** between the two versions.\n\n**cp311** — delegates entirely to the external helper imported from `h5_to_db`:\n```python\nfrom h5_to_db import *\n# ...\nimport_into_colmap(img_dir, feature_dir=feature_dir, database_path=database_path)\n```\nThe implementation is hidden inside the `pycolmap3-11-imc-utils` dataset. It presumably uses the pycolmap 3.x `Database` high-level API.\n\n**cp312** — fully reimplements this function from scratch using raw `sqlite3`, because the pycolmap 4.0.3 `Database` API changed incompatibly. It manually:\n1. Creates the COLMAP database schema with `CREATE TABLE IF NOT EXISTS` for all six COLMAP tables (`cameras`, `images`, `keypoints`, `matches`, `two_view_geometries`, `descriptors`).\n2. Reads `keypoints.h5` and for each image inserts a row into `cameras` (using `SIMPLE_RADIAL` model with `f = max(w,h)`, `cx = w/2`, `cy = h/2`, `k = 0`) and a row into `images`.\n3. Inserts keypoint blobs directly as `float32` bytes.\n4. Reads `matches.h5` and inserts match blobs as `uint32` bytes, using the standard COLMAP `pair_id = id1 * 2147483647 + id2` encoding.\n\nThe end result is the same SQLite database structure COLMAP expects, but the path to get there is completely different.\n\n---\n\n### Stage 6 — Geometric Verification & Incremental Mapping (`reconstruct_from_db`) ⚠️ **Minor API difference**\n\nBoth versions call the same two pycolmap functions:\n\n```python\npycolmap.verify_matches(database_path, pairs_path, TwoViewGeometryOptions())\npycolmap.incremental_mapping(database_path, image_path, output_path, options)\n```\n\n`verify_matches` runs RANSAC (fundamental/essential matrix estimation) on each pair and writes verified inlier geometries back into `two_view_geometries`. \n`incremental_mapping` then performs full SfM — incremental reconstruction of camera poses.\n\nThe only code-level difference is in how the resulting rotation/translation is accessed after mapping:\n\n| | cp311 | cp312 |\n|---|---|---|\n| Access pattern | `image.cam_from_world.rotation` | `image.cam_from_world().rotation` |\n| Reason | pycolmap 3.x: `cam_from_world` is an attribute | pycolmap 4.x: `cam_from_world` is a method |\n\n**→ Semantically identical; syntax differs due to pycolmap API break.**\n\n---\n\n## Summary Table\n\n| Stage | cp311 | cp312 | Same? |\n|---|---|---|---|\n| MASt3R inference + correspondence extraction | `extract_correspondences_nonsym` | same | ✅ |\n| Coordinate back-projection to original space | `transform_keypoints_to_original` | same | ✅ |\n| Keypoint unification & global ID assignment | `unify_keypoints_and_matches` | same | ✅ |\n| HDF5 serialization | `save_unified_keypoints_and_matches` | same | ✅ |\n| COLMAP DB import | external `h5_to_db` helper (pycolmap 3.x API) | custom raw `sqlite3` reimplementation | ❌ |\n| Geometric verification + mapping | `verify_matches` + `incremental_mapping` | same (minor `cam_from_world()` syntax fix) | ⚠️ |\n\nThe overall **conversion strategy is identical** — both pipelines go through the same intermediate HDF5 format before feeding COLMAP. The divergence is purely in **how the COLMAP database is populated** (Stage 5), forced by the breaking changes in pycolmap 4.0.3.","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}},{"cell_type":"markdown","source":"cp311からcp312への移行に伴う変更点の構造化サマリーを日本語に翻訳しました。\n\n---\n\n## cp311 → cp312 の変更点\n\n### 1. Python および Wheel の互換性\n- **pycolmapのアップグレード**: cp311用のWheel (`pycolmap-3.11.1-cp311`) が、ユーザーデータセットから取得した `pycolmap-4.0.3-cp312` に置き換えられました。\n- すべてのMASt3R関連のWheelおよびパスが、`/kaggle/input/mast3r-fix/` から `/kaggle/input/notebooks/stpeteishii/mast3r-cp312/` に変更されました。\n- Pythonのバージョンを明示的に確認するため、初期段階に `print(sys.version)` が追加されました。\n\n### 2. FAISS のインストール\n- cp311では単一の `faiss-gpu-cu12` をインストールしていましたが、cp312では専用データセットから FAISS および CUDA 依存関係 (`faiss_gpu_cu12`, `nvidia_cublas_cu12`, `nvidia_cuda_runtime_cu12`) の3つのWheelを明示的にインストールするように変更されました。\n\n### 3. `import_into_colmap` — フル書き換え\n- cp311は `h5_to_db` の外部関数に依存していましたが、cp312では **`sqlite3` を使用してこの関数を一から書き直しています**。\n- pycolmap 4.0.3 で `Database` API が大幅に変更されたため、COLMAPデータベースのスキーマ作成、カメラ、画像、キーポイント、マッチング情報の挿入を手動で行う必要がありました。また、`pycolmap.Database` メソッドのデバッグ用イントロスペクションも追加されています。\n\n### 4. pycolmap API の破壊的変更 — `cam_from_world`\n- `reconstruct_from_db` 内において、cp311では `image.cam_from_world.rotation` (属性) としてアクセスしていましたが、cp312では `image.cam_from_world().rotation` (メソッド呼び出し) に変更されました。これは pycolmap 4.0.3 の変更に適応したものです。\n\n### 5. cp312用 ASMK `.so` ファイルのロード\n- ASMKのコンパイル済み拡張機能はPythonバージョンに依存するため、cp312では `importlib.util.spec_from_file_location` を使用して、特定の `.so` ファイル (`hamming.cpython-312-x86_64-linux-gnu.so`) を手動でロードする処理が追加されました。\n\n### 6. ASMK / FAISS のモンキーパッチ\n- **`FaissGpuL2Index` パッチ**: 互換性のための回避策として、`asmk_index.FaissGpuL2Index.create_index` が CPU 用の `IndexFlatL2` を使用するように修正されました。\n- **`Codebook.quantize` パッチ**: `_fixed_quantize` 関数が追加され、`asmk_codebook.Codebook.quantize` にパッチが適用されました。これにより、オンデマンドでの FAISS インデックス再構築や、`build_ivf` (引数3つ) と `query_ivf` (引数2つ) のパス間における引数の不一致が修正されました。\n\n### 7. モデルのロード — `torch.serialization` の修正\n- PyTorch の新しいバージョンで導入された厳格なセーフ・デシリアライゼーション要件を満たすため、`load_model` を呼び出す前に `torch.serialization.add_safe_globals([argparse.Namespace])` が追加されました。\n\n### 8. `run_one_dataset` の堅牢性向上\n- ショートリスト作成後に `indexed_pairs` が空の場合、クラッシュせずにログを出力して正常にスキップするガード処理が追加されました。\n- `except` ブロックに `traceback.print_exc()` が追加され、より詳細なエラーレポートが可能になりました。\n\n### 9. `reconstruct_from_db` — 詳細ログの出力\n- 進行状況をステップごとに把握し、失敗箇所の診断を容易にするため、`sys.stdout.flush()` を含む `log()` ヘルパー関数が追加されました。\n\n### 10. スレッドプール — `max_workers` の削減\n- `run_mast3r_pipeline` 内の `ThreadPoolExecutor` が、`max_workers=2` (cp311) から `max_workers=1` (cp312) に変更されました。これはメモリ負荷の軽減、または新しい環境下でのレースコンディション回避が目的と考えられます。\n\n### 11. データセットおよび入力パスの変更\n- `data_dir` が `/kaggle/input/image-matching-challenge-2025` から `/kaggle/input/competitions/image-matching-challenge-2025` に変更されました。\n- imc-utils の `sys.path` エントリが更新され、スコアリングブロック内のメトリック CSV パスもそれに合わせて修正されました。\n\n---\n\n**まとめ**: cp312 への移行は、主に pycolmap のアップグレード (3.11.1 → 4.0.3) に伴う API 変更への対応、Python 3.12 用の ASMK 拡張機能および FAISS 統合の適応、そして PyTorch のシリアライゼーション修正が中心となっています。これらの互換性修正に加え、エラーハンドリングやログ出力、空ペア対策など、堅牢性と観測性を高めるための改善も数多く導入されています。","metadata":{}},{"cell_type":"markdown","source":"MASt3Rの出力からCOLMAP形式への変換パイプライン全行程の詳細な分析と、cp311とcp312で共通する点・異なる点のまとめを日本語に翻訳しました。\n\n---\n\n## パイプラインの概要\n\n変換は以下の **6つの連続したステージ** で構成されています。\n\n\n\n```\nMASt3R 推論 (Inference)\n ↓\n [1] extract_correspondences_nonsym → 生ピクセルマッチング\n ↓\n [2] transform_keypoints_to_original → 元画像空間の座標へ変換\n ↓\n [3] unify_keypoints_and_matches → グローバルな特徴点IDの割り当て\n ↓\n [4] save_unified_keypoints_and_matches → keypoints.h5 / matches.h5 / pairs.txt\n ↓\n [5] import_into_colmap → COLMAP SQLite データベース\n ↓\n [6] verify_matches + incremental_mapping → 再構成されたポーズ\n```\n\n---\n\n## ステージ別詳細解説\n\n### ステージ 1 — MASt3R推論と対応関係の抽出 (`match_with_mast3r_and_save`)\n\n各画像ペアに対して以下の処理を行います:\n1. `load_images()` で両方の画像を512pxにリサイズします(DUST3Rの慣習)。\n2. `inference()` でMASt3Rのエンコーダー・デコーダーを実行し、両方の視点の密な記述子マップ (`desc`) と信頼度マップ (`desc_conf`) を生成します。\n3. `extract_correspondences_nonsym()` で記述子空間における非対称な最近傍対応を計算し、**リサイズ/クロップ後**の画像空間でのマッチングピクセル座標 `(x, y)` と信頼度スコアを返します。\n4. `CONFIG.MATCH_CONF_TH = 1.001` 未満のマッチングは破棄され、さらに端の3ピクセルを除外するマスクが適用されます。\n\n**→ cp311 と cp312 で同一。**\n\n---\n\n### ステージ 2 — 座標の逆投影 (`transform_keypoints_to_original`)\n\n`load_images()` は画像をリサイズし、センタークロップしてからMASt3Rに渡すため、マッチング座標は「処理後の画像空間」になっています。この関数はクロップのオフセットとスケール因子を逆算し、**元の画像空間**の座標を復元します。\n\n計算内容:\n- リサイズスケール因子(長辺 → 512)を再計算。\n- クロップオフセット(16ピクセルグリッドに整列された `halfw`, `halfh`)を再計算。\n- オフセットを加算し、スケール因子で割ることで元座標を算出。\n\n**→ cp311 と cp312 で同一。**\n\n---\n\n### ステージ 3 — 特徴点の統一化 (`unify_keypoints_and_matches`)\n\n1枚の画像は複数のペアに登場するため、同じ物理的な点がペアごとに微妙に異なる浮動小数点座標として検出されることがあります。このステージでは:\n1. すべてのペアから、各画像ごとの全座標を収集します。\n2. 座標を小数点第1位で丸め、`np.unique` を使って重複を排除します。\n3. 重複を除いた各座標に **グローバルな整数ID** を割り当てます。\n4. 各ペアの座標ベースのマッチング `(x1,y1,x2,y2)` を、ルックアップテーブルを用いてグローバルIDのペア `(id1, id2)` に変換します。\n\nこれにより、COLMAP互換のデータ構造である `global_keypoints[img]` と `global_matches[(img1, img2)]` が生成されます。\n\n**→ cp311 と cp312 で同一。**\n\n---\n\n### ステージ 4 — HDF5 シリアライズ (`save_unified_keypoints_and_matches`)\n\n`feature_dir` に以下の3つのファイルを出力します:\n- `keypoints.h5` — 画像ごとの `(N, 2)` 座標配列。\n- `matches.h5` — ペアごとの `(M, 2)` グローバルID配列(`MAST3R_MIN_PAIR = 15` 以上のマッチングがあるペアのみ)。\n- `pairs.txt` — 画像名のペアリスト(`verify_matches` の入力に使用)。\n\n**→ cp311 と cp312 で同一。**\n\n---\n\n### ステージ 5 — COLMAP データベースへのインポート (`import_into_colmap`) ⚠️ **相違点**\n\nこのステージは、2つのバージョン間で**根本的な設計が異なる唯一の箇所**です。\n\n**cp311** — `h5_to_db` からインポートされた外部ヘルパー関数にすべてを委ねます。\n```python\nfrom h5_to_db import *\nimport_into_colmap(img_dir, feature_dir=feature_dir, database_path=database_path)\n```\n実装は `pycolmap3-11-imc-utils` データセット内に隠蔽されており、おそらく pycolmap 3.x の高レベル `Database` API を使用しています。\n\n**cp312** — pycolmap 4.0.3 の `Database` API に非互換な変更があったため、生の `sqlite3` を使用して**この関数をゼロから完全に再実装**しています。手動で以下の処理を行います:\n1. COLMAPの6つのテーブル(`cameras`, `images`, `keypoints`, `matches`, `two_view_geometries`, `descriptors`)のスキーマを `CREATE TABLE IF NOT EXISTS` で作成。\n2. `keypoints.h5` を読み込み、各画像に対して `cameras` 行(`SIMPLE_RADIAL` モデルを使用し、`f = max(w,h)`, `cx = w/2`, `cy = h/2`, `k = 0` と設定)と `images` 行を挿入。\n3. 特徴点のバイナリデータ(Blob)を `float32` バイトとして直接挿入。\n4. `matches.h5` を読み込み、標準的な COLMAP のエンコーディング方式 `pair_id = id1 * 2147483647 + id2` を用いてマッチングデータを `uint32` バイトとして挿入。\n\n最終的に生成される SQLite データベースの構造は同じですが、そこに至るプロセスが完全に異なります。\n\n---\n\n### ステージ 6 — 幾何学的検証と増分復元 (`reconstruct_from_db`) ⚠️ **軽微なAPIの差**\n\n両方のバージョンで同じ2つの pycolmap 関数を呼び出します:\n```python\npycolmap.verify_matches(database_path, pairs_path, TwoViewGeometryOptions())\npycolmap.incremental_mapping(database_path, image_path, output_path, options)\n```\n- `verify_matches`: 各ペアに対して RANSAC(基礎行列/本質行列の推定)を実行し、検証済みのインライア幾何情報を `two_view_geometries` に書き戻します。\n- `incremental_mapping`: 完全な SfM(Structure from Motion)を実行し、カメラポーズを段階的に復元します。\n\nコード上の唯一の違いは、マッピング後の回転・並進情報の取得方法です。\n\n| | cp311 | cp312 |\n|---|---|---|\n| アクセス形式 | `image.cam_from_world.rotation` | `image.cam_from_world().rotation` |\n| 理由 | pycolmap 3.x: 属性(attribute) | pycolmap 4.x: メソッド呼び出し |\n\n**→ 意味的には同一ですが、APIの変更により構文が異なります。**\n\n---\n\n## 比較まとめ表\n\n| ステージ | cp311 | cp312 | 同一? |\n|---|---|---|---|\n| MASt3R推論 + 対応関係抽出 | `extract_correspondences_nonsym` | 同左 | ✅ |\n| 元画像空間への座標逆投影 | `transform_keypoints_to_original` | 同左 | ✅ |\n| 特徴点統一 & グローバルID付与 | `unify_keypoints_and_matches` | 同左 | ✅ |\n| HDF5 シリアライズ | `save_unified_keypoints_and_matches` | 同左 | ✅ |\n| COLMAP DB インポート | 外部 `h5_to_db` (pycolmap 3.x API) | 独自の `sqlite3` 再実装 | ❌ |\n| 幾何検証 + マッピング | `verify_matches` + `incremental_mapping` | 同左(`cam_from_world()` 構文のみ修正) | ⚠️ |\n\n全体として、**変換戦略そのものは同一**です。どちらのパイプラインも COLMAP に投入する前に同じ中間 HDF5 形式を経由します。相違点は純粋に、pycolmap 4.0.3 の破壊的変更によって強制された **COLMAP データベースへのデータ投入方法(ステージ 5)** にあります。","metadata":{}},{"cell_type":"markdown","source":"","metadata":{}}]}