Skip to content

Commit 1cb28f2

Browse files
committed
Merge branch 'ui-refactor-log-visibility'
2 parents 49ea467 + 9a7a346 commit 1cb28f2

5 files changed

Lines changed: 1682 additions & 128 deletions

File tree

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,12 @@ This entire section is provided by the "Advanced Yaw Selector" module.
278278

279279
* **COLMAP Rig Folder:** Select the `colmap_rig` folder (must contain `images/` and `rig_config.json`).
280280
* **COLMAP Executable:** Path to `colmap.exe` (or `colmap` on macOS/Linux).
281-
* **Matcher:** Choose `sequential` for video-style matching or `exhaustive` for full pair matching.
281+
* **Preset:** Choose from Standard / Balanced / Ultra Detail / Multi-Path Sync.
282+
* **Advanced...:** Fine-tune COLMAP options (SIFT, matching, rig refinement, loop detection).
283+
* **Matcher:** Choose `sequential`, `exhaustive`, or `vocab_tree`.
284+
* **Vocab Tree:** Dictionary file for `vocab_tree` matcher or loop detection. Auto-detected from the COLMAP executable if available.
282285
* **Postshot Output:** Output folder for Postshot-ready data. Default is `<colmap_rig>/postshot`.
283-
* **Database:** `database.db` is created inside the COLMAP Rig folder. Existing DB requires confirmation to overwrite.
286+
* **Database:** `database.db` is created inside the COLMAP Rig folder. If it already exists, choose overwrite or resume (with step selection).
284287
* **Run COLMAP:** Executes feature_extractor → rig_configurator → matcher → mapper → image_undistorter.
285288

286289
**4.5. Controls and Progress**
@@ -402,9 +405,12 @@ The application window includes a menu bar at the top.
402405

403406
* **COLMAP Rigフォルダ:** `colmap_rig` フォルダを選択(`images/``rig_config.json` が必要)。
404407
* **COLMAP実行ファイル:** `colmap.exe`(または macOS/Linux では `colmap`)のパス。
405-
* **Matcher:** `sequential`(動画向け)または `exhaustive`(全組み合わせ、重いが繋がりやすい)を選択。
408+
* **Preset:** Standard / Balanced / Ultra Detail / Multi-Path Sync を選択。
409+
* **Advanced...:** COLMAPの詳細オプション(SIFT/Matching/Rig/Loop)を調整。
410+
* **Matcher:** `sequential` / `exhaustive` / `vocab_tree` を選択。
411+
* **Vocab Tree:** `vocab_tree` matcher やループ検出用の辞書ファイル。COLMAP実行ファイルの場所から自動検出。
406412
* **Postshot出力先:** Postshot用データの出力先。デフォルトは `<colmap_rig>/postshot`
407-
* **Database:** `database.db` は COLMAP Rigフォルダ内に作成。既存DBは上書き確認あり
413+
* **Database:** `database.db` は COLMAP Rigフォルダ内に作成。既存DBは「上書き/再開」を選択
408414
* **COLMAP実行:** feature_extractor → rig_configurator → matcher → mapper → image_undistorter を実行。
409415

410416
**4.5. コントロールと進捗**

colmap_pipeline_options.py

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# colmap_pipeline_options.py
2+
# Helpers for COLMAP pipeline presets and options
3+
4+
from __future__ import annotations
5+
6+
import os
7+
8+
VOCAB_TREE_PRIORITY_NAMES = (
9+
"vocab_tree_faiss_flickr100K_words256K.bin",
10+
"vocab_tree_faiss_flickr100K_words1M.bin",
11+
"vocab_tree_flickr100K_words256K.bin",
12+
"vocab_tree_flickr100K_words1M.bin",
13+
)
14+
15+
16+
def _copy_options(options):
17+
return {section: dict(values) for section, values in options.items()}
18+
19+
20+
BALANCED_OPTIONS = {
21+
"feature": {
22+
"SiftExtraction.max_num_features": 16384,
23+
"SiftExtraction.estimate_affine_shape": 1,
24+
"SiftExtraction.domain_size_pooling": 1,
25+
},
26+
"matcher": {
27+
"FeatureMatching.guided_matching": 1,
28+
},
29+
"mapper": {
30+
"Mapper.ba_refine_sensor_from_rig": 1,
31+
},
32+
}
33+
34+
ULTRA_OPTIONS = _copy_options(BALANCED_OPTIONS)
35+
ULTRA_OPTIONS["feature"]["SiftExtraction.max_num_features"] = 32768
36+
37+
38+
COLMAP_PRESETS = {
39+
"standard": {
40+
"matcher": "sequential",
41+
"options": {},
42+
},
43+
"balanced": {
44+
"matcher": "sequential",
45+
"options": BALANCED_OPTIONS,
46+
},
47+
"ultra": {
48+
"matcher": "sequential",
49+
"options": ULTRA_OPTIONS,
50+
},
51+
"multi_path": {
52+
"matcher": "vocab_tree",
53+
"options": BALANCED_OPTIONS,
54+
},
55+
}
56+
57+
58+
def merge_options(base, preset, overrides):
59+
merged = {}
60+
for source in (base or {}, preset or {}, overrides or {}):
61+
for section, options in source.items():
62+
if not options:
63+
continue
64+
merged_section = merged.setdefault(section, {})
65+
merged_section.update(options)
66+
return merged
67+
68+
69+
def _stringify_option_value(value):
70+
if isinstance(value, bool):
71+
return "1" if value else "0"
72+
return str(value)
73+
74+
75+
def build_colmap_command(base_command, options, supported_options=None, alias_map=None, skipped=None):
76+
command = list(base_command)
77+
if not options:
78+
return command
79+
for key, value in options.items():
80+
if value is None:
81+
continue
82+
if isinstance(value, str) and not value.strip():
83+
continue
84+
option_key = key
85+
if supported_options is not None and key not in supported_options:
86+
option_key = None
87+
if alias_map and key in alias_map:
88+
candidates = alias_map[key]
89+
if isinstance(candidates, str):
90+
candidates = [candidates]
91+
for candidate in candidates:
92+
if candidate in supported_options:
93+
option_key = candidate
94+
break
95+
if option_key is None:
96+
if skipped is not None:
97+
skipped.append(key)
98+
continue
99+
command.extend([f"--{option_key}", _stringify_option_value(value)])
100+
return command
101+
102+
103+
def find_vocab_tree_path(colmap_exec_path):
104+
if not colmap_exec_path or not os.path.isfile(colmap_exec_path):
105+
return None
106+
exe_dir = os.path.dirname(os.path.abspath(colmap_exec_path))
107+
candidate_dirs = [
108+
exe_dir,
109+
os.path.abspath(os.path.join(exe_dir, os.pardir)),
110+
os.path.abspath(os.path.join(exe_dir, os.pardir, "share", "colmap")),
111+
os.path.abspath(os.path.join(exe_dir, os.pardir, os.pardir, "share", "colmap")),
112+
]
113+
seen = set()
114+
search_dirs = []
115+
for directory in candidate_dirs:
116+
if directory in seen:
117+
continue
118+
seen.add(directory)
119+
search_dirs.append(directory)
120+
121+
for name in VOCAB_TREE_PRIORITY_NAMES:
122+
for directory in search_dirs:
123+
candidate = os.path.join(directory, name)
124+
if os.path.isfile(candidate):
125+
return candidate
126+
127+
for directory in search_dirs:
128+
if not os.path.isdir(directory):
129+
continue
130+
try:
131+
entries = sorted(os.listdir(directory))
132+
except OSError:
133+
continue
134+
for entry in entries:
135+
if entry.startswith("vocab_tree_") and entry.endswith(".bin"):
136+
candidate = os.path.join(directory, entry)
137+
if os.path.isfile(candidate):
138+
return candidate
139+
return None

constants.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# アプリケーション全体で使用する定数 (翻訳不要なもの)
33

44
# --- バージョン情報 ---
5-
APP_RELEASE_DATE = "2025-12-25" # リリース日 (ユーザー提供の値を維持)
5+
APP_RELEASE_DATE = "2025-12-27" # リリース日 (ユーザー提供の値を維持)
66

77
APP_VERSION_MAJOR = 2
88
APP_VERSION_MINOR = 3
9-
APP_VERSION_PATCH = 0
9+
APP_VERSION_PATCH = 1
1010
APP_VERSION_STRING_SEMVER = f"v{APP_VERSION_MAJOR}.{APP_VERSION_MINOR}.{APP_VERSION_PATCH}"
1111

1212
# --- FFmpeg関連定数 ---
@@ -15,6 +15,9 @@
1515
DEFAULT_RESOLUTION_WIDTH = 1920 # 解像度指定が無効な場合のフォールバック値
1616
HIGH_RESOLUTION_THRESHOLD = 4096 # この解像度を超える入力は高解像度とみなし、CUDA互換性テストの対象とする
1717

18+
# --- COLMAP関連定数 ---
19+
COLMAP_DEFAULT_PRESET_KEY = "balanced"
20+
1821
# --- GitHub関連定数 (アップデートチェック用) ---
1922
GITHUB_REPO_OWNER = "stechdrive"
2023
GITHUB_REPO_NAME = "Insta360Convert-GUI"

0 commit comments

Comments
 (0)