stpete2 commited on
Commit
21be490
·
verified ·
1 Parent(s): c5e7640

Delete biplet_colmap_2dgs_colab_04.ipynb

Browse files
Files changed (1) hide show
  1. biplet_colmap_2dgs_colab_04.ipynb +0 -1254
biplet_colmap_2dgs_colab_04.ipynb DELETED
@@ -1,1254 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "markdown",
5
- "id": "fb1f1fdc",
6
- "metadata": {
7
- "papermill": {
8
- "duration": 0.002985,
9
- "end_time": "2026-01-10T18:17:32.170524",
10
- "exception": false,
11
- "start_time": "2026-01-10T18:17:32.167539",
12
- "status": "completed"
13
- },
14
- "tags": [],
15
- "id": "fb1f1fdc"
16
- },
17
- "source": [
18
- "# **biplet-dino-colmap-2dgs**"
19
- ]
20
- },
21
- {
22
- "cell_type": "code",
23
- "source": [
24
- "#サイズの異なる画像を扱う\n",
25
- "from google.colab import drive\n",
26
- "drive.mount('/content/drive')"
27
- ],
28
- "metadata": {
29
- "id": "JON4rYSEOzCg"
30
- },
31
- "id": "JON4rYSEOzCg",
32
- "execution_count": null,
33
- "outputs": []
34
- },
35
- {
36
- "cell_type": "code",
37
- "execution_count": null,
38
- "id": "22353010",
39
- "metadata": {
40
- "execution": {
41
- "iopub.execute_input": "2026-01-10T18:17:32.181455Z",
42
- "iopub.status.busy": "2026-01-10T18:17:32.180969Z",
43
- "iopub.status.idle": "2026-01-10T18:17:32.355942Z",
44
- "shell.execute_reply": "2026-01-10T18:17:32.355229Z"
45
- },
46
- "papermill": {
47
- "duration": 0.179454,
48
- "end_time": "2026-01-10T18:17:32.357275",
49
- "exception": false,
50
- "start_time": "2026-01-10T18:17:32.177821",
51
- "status": "completed"
52
- },
53
- "tags": [],
54
- "id": "22353010"
55
- },
56
- "outputs": [],
57
- "source": [
58
- "import os\n",
59
- "import sys\n",
60
- "import subprocess\n",
61
- "import shutil\n",
62
- "from pathlib import Path\n",
63
- "import cv2\n",
64
- "from PIL import Image\n",
65
- "import glob\n",
66
- "\n",
67
- "IMAGE_PATH=\"/content/drive/MyDrive/your_folder/fountain100\"\n",
68
- "\n",
69
- "#WORK_DIR = '/content/gaussian-splatting'\n",
70
- "WORK_DIR = \"/content/2d-gaussian-splatting\"\n",
71
- "\n",
72
- "OUTPUT_DIR = '/content/output'\n",
73
- "COLMAP_DIR = '/content/colmap_data'"
74
- ]
75
- },
76
- {
77
- "cell_type": "code",
78
- "execution_count": null,
79
- "id": "be6df249",
80
- "metadata": {
81
- "execution": {
82
- "iopub.execute_input": "2026-01-10T18:17:32.363444Z",
83
- "iopub.status.busy": "2026-01-10T18:17:32.363175Z",
84
- "iopub.status.idle": "2026-01-10T18:22:43.720241Z",
85
- "shell.execute_reply": "2026-01-10T18:22:43.719380Z"
86
- },
87
- "papermill": {
88
- "duration": 311.361656,
89
- "end_time": "2026-01-10T18:22:43.721610",
90
- "exception": false,
91
- "start_time": "2026-01-10T18:17:32.359954",
92
- "status": "completed"
93
- },
94
- "tags": [],
95
- "id": "be6df249"
96
- },
97
- "outputs": [],
98
- "source": [
99
- "def run_cmd(cmd, check=True, capture=False, cwd=None): # ← cwd=None を追加\n",
100
- " \"\"\"Run command with better error handling\"\"\"\n",
101
- " print(f\"Running: {' '.join(cmd)}\")\n",
102
- " result = subprocess.run(\n",
103
- " cmd,\n",
104
- " capture_output=capture,\n",
105
- " text=True,\n",
106
- " check=False,\n",
107
- " cwd=cwd # ← ここに渡す\n",
108
- " )\n",
109
- " if check and result.returncode != 0:\n",
110
- " print(f\"❌ Command failed with code {result.returncode}\")\n",
111
- " if capture:\n",
112
- " print(f\"STDOUT: {result.stdout}\")\n",
113
- " print(f\"STDERR: {result.stderr}\")\n",
114
- " return result\n",
115
- "\n",
116
- "\n",
117
- "def setup_environment():\n",
118
- " \"\"\"\n",
119
- " Colab environment setup for Gaussian Splatting + LightGlue + pycolmap\n",
120
- " Python 3.12 compatible version (v8)\n",
121
- " \"\"\"\n",
122
- "\n",
123
- " print(\"🚀 Setting up COLAB environment (v8 - Python 3.12 compatible)\")\n",
124
- "\n",
125
- " WORK_DIR = \"gaussian-splatting\"\n",
126
- "\n",
127
- " # =====================================================================\n",
128
- " # STEP 0: NumPy FIX (Python 3.12 compatible)\n",
129
- " # =====================================================================\n",
130
- " print(\"\\n\" + \"=\"*70)\n",
131
- " print(\"STEP 0: Fix NumPy (Python 3.12 compatible)\")\n",
132
- " print(\"=\"*70)\n",
133
- "\n",
134
- " # Python 3.12 requires numpy >= 1.26\n",
135
- " run_cmd([sys.executable, \"-m\", \"pip\", \"uninstall\", \"-y\", \"numpy\"])\n",
136
- " run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"numpy==1.26.4\"])\n",
137
- "\n",
138
- " # sanity check\n",
139
- " run_cmd([sys.executable, \"-c\", \"import numpy; print('NumPy:', numpy.__version__)\"])\n",
140
- "\n",
141
- " # =====================================================================\n",
142
- " # STEP 1: System packages (Colab)\n",
143
- " # =====================================================================\n",
144
- " print(\"\\n\" + \"=\"*70)\n",
145
- " print(\"STEP 1: System packages\")\n",
146
- " print(\"=\"*70)\n",
147
- "\n",
148
- " run_cmd([\"apt-get\", \"update\", \"-qq\"])\n",
149
- " run_cmd([\n",
150
- " \"apt-get\", \"install\", \"-y\", \"-qq\",\n",
151
- " \"colmap\",\n",
152
- " \"build-essential\",\n",
153
- " \"cmake\",\n",
154
- " \"git\",\n",
155
- " \"libopenblas-dev\",\n",
156
- " \"xvfb\"\n",
157
- " ])\n",
158
- "\n",
159
- " # virtual display (COLMAP / OpenCV safety)\n",
160
- " os.environ[\"QT_QPA_PLATFORM\"] = \"offscreen\"\n",
161
- " os.environ[\"DISPLAY\"] = \":99\"\n",
162
- " subprocess.Popen(\n",
163
- " [\"Xvfb\", \":99\", \"-screen\", \"0\", \"1024x768x24\"],\n",
164
- " stdout=subprocess.DEVNULL,\n",
165
- " stderr=subprocess.DEVNULL\n",
166
- " )\n",
167
- "\n",
168
- " # =====================================================================\n",
169
- " # STEP 2: Clone 2D Gaussian Splatting\n",
170
- " # =====================================================================\n",
171
- " print(\"\\n\" + \"=\"*70)\n",
172
- " print(\"STEP 2: Clone Gaussian Splatting\")\n",
173
- " print(\"=\"*70)\n",
174
- "\n",
175
- " if not os.path.exists(WORK_DIR):\n",
176
- " run_cmd([\n",
177
- " \"git\", \"clone\", \"--recursive\",\n",
178
- " \"https://github.com/hbb1/2d-gaussian-splatting.git\",\n",
179
- " WORK_DIR\n",
180
- " ])\n",
181
- " else:\n",
182
- " print(\"✓ Repository already exists\")\n",
183
- "\n",
184
- " # =====================================================================\n",
185
- " # STEP 3: Python packages (FIXED ORDER & VERSIONS)\n",
186
- " # =====================================================================\n",
187
- " print(\"\\n\" + \"=\"*70)\n",
188
- " print(\"STEP 3: Python packages (VERBOSE MODE)\")\n",
189
- " print(\"=\"*70)\n",
190
- "\n",
191
- " # ---- PyTorch (Colab CUDA対応) ----\n",
192
- " print(\"\\n📦 Installing PyTorch...\")\n",
193
- " run_cmd([\n",
194
- " sys.executable, \"-m\", \"pip\", \"install\",\n",
195
- " \"torch\", \"torchvision\", \"torchaudio\"\n",
196
- " ])\n",
197
- "\n",
198
- " # ---- Core utils ----\n",
199
- " print(\"\\n📦 Installing core utilities...\")\n",
200
- " run_cmd([\n",
201
- " sys.executable, \"-m\", \"pip\", \"install\",\n",
202
- " \"opencv-python\",\n",
203
- " \"pillow\",\n",
204
- " \"imageio\",\n",
205
- " \"imageio-ffmpeg\",\n",
206
- " \"plyfile\",\n",
207
- " \"tqdm\",\n",
208
- " \"tensorboard\"\n",
209
- " ])\n",
210
- "\n",
211
- " # ---- transformers (NumPy 1.26 compatible) ----\n",
212
- " print(\"\\n📦 Installing transformers (NumPy 1.26 compatible)...\")\n",
213
- " # Install transformers with proper dependencies\n",
214
- " run_cmd([\n",
215
- " sys.executable, \"-m\", \"pip\", \"install\",\n",
216
- " \"transformers==4.40.0\"\n",
217
- " ])\n",
218
- "\n",
219
- " # ---- LightGlue stack (GITHUB INSTALL) ----\n",
220
- " print(\"\\n📦 Installing LightGlue stack...\")\n",
221
- "\n",
222
- " # Install kornia first\n",
223
- " run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"kornia\"])\n",
224
- "\n",
225
- " # Install h5py (sometimes needed)\n",
226
- " run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"h5py\"])\n",
227
- "\n",
228
- " # Install matplotlib (LightGlue dependency)\n",
229
- " run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"matplotlib\"])\n",
230
- "\n",
231
- " # Install pycolmap\n",
232
- " run_cmd([sys.executable, \"-m\", \"pip\", \"install\", \"pycolmap\"])\n",
233
- "\n",
234
- "\n",
235
- " # =====================================================================\n",
236
- " # STEP 4: Build 2D GS submodules (確実な方法)\n",
237
- " # =====================================================================\n",
238
- " print(\"\\n\" + \"=\"*70)\n",
239
- " print(\"STEP 4: Build Gaussian Splatting submodules\")\n",
240
- " print(\"=\"*70)\n",
241
- "\n",
242
- " # クローン先とリポジトリURLの定義\n",
243
- " submodules = [\n",
244
- " {\n",
245
- " \"path\": os.path.join(WORK_DIR, \"submodules\", \"diff-surfel-rasterization\"),\n",
246
- " \"url\": \"https://github.com/hbb1/diff-surfel-rasterization.git\"\n",
247
- " },\n",
248
- " {\n",
249
- " \"path\": os.path.join(WORK_DIR, \"submodules\", \"simple-knn\"),\n",
250
- " \"url\": \"https://github.com/camenduru/simple-knn.git\"\n",
251
- " }\n",
252
- " ]\n",
253
- "\n",
254
- " for submodule in submodules:\n",
255
- " path = submodule[\"path\"]\n",
256
- " url = submodule[\"url\"]\n",
257
- " name = os.path.basename(path)\n",
258
- "\n",
259
- " print(f\"\\n📦 Processing {name}...\")\n",
260
- "\n",
261
- " # 1. git clone (ディレクトリがない場合のみ)\n",
262
- " if not os.path.exists(path):\n",
263
- " print(f\" > Cloning {url}...\")\n",
264
- " # 親ディレクトリが存在することを確認\n",
265
- " os.makedirs(os.path.dirname(path), exist_ok=True)\n",
266
- " run_cmd([\"git\", \"clone\", url, path])\n",
267
- " else:\n",
268
- " print(f\" ✓ {name} already exists.\")\n",
269
- "\n",
270
- " # 2. setup.py install (コンパイル)\n",
271
- " print(f\" > Compiling and Installing {name}...\")\n",
272
- " # 捕捉してエラーメッセージを見やすくする\n",
273
- " result = run_cmd(\n",
274
- " [sys.executable, \"setup.py\", \"install\"],\n",
275
- " cwd=path,\n",
276
- " check=False, # エラーでも止めない\n",
277
- " capture=True\n",
278
- " )\n",
279
- "\n",
280
- " if result.returncode != 0:\n",
281
- " print(f\"❌ Failed to build {name}\")\n",
282
- " print(\"--- STDERR ---\")\n",
283
- " print(result.stderr)\n",
284
- " else:\n",
285
- " print(f\"✅ Successfully built {name}\")\n",
286
- "\n",
287
- " # =====================================================================\n",
288
- " # STEP 5: Detailed Verification\n",
289
- " # =====================================================================\n",
290
- " print(\"\\n\" + \"=\"*70)\n",
291
- " print(\"STEP 5: Detailed Verification\")\n",
292
- " print(\"=\"*70)\n",
293
- "\n",
294
- " # NumPy (verify version first)\n",
295
- " print(\"\\n🔍 Testing NumPy...\")\n",
296
- " try:\n",
297
- " import numpy as np\n",
298
- " print(f\" ✓ NumPy: {np.__version__}\")\n",
299
- " except Exception as e:\n",
300
- " print(f\" ❌ NumPy failed: {e}\")\n",
301
- "\n",
302
- " # PyTorch\n",
303
- " print(\"\\n🔍 Testing PyTorch...\")\n",
304
- " try:\n",
305
- " import torch\n",
306
- " print(f\" ✓ PyTorch: {torch.__version__}\")\n",
307
- " print(f\" ✓ CUDA available: {torch.cuda.is_available()}\")\n",
308
- " if torch.cuda.is_available():\n",
309
- " print(f\" ✓ CUDA version: {torch.version.cuda}\")\n",
310
- " except Exception as e:\n",
311
- " print(f\" ❌ PyTorch failed: {e}\")\n",
312
- "\n",
313
- " # transformers\n",
314
- " print(\"\\n🔍 Testing transformers...\")\n",
315
- " try:\n",
316
- " import transformers\n",
317
- " print(f\" ✓ transformers version: {transformers.__version__}\")\n",
318
- " from transformers import AutoModel\n",
319
- " print(f\" ✓ AutoModel import: OK\")\n",
320
- " except Exception as e:\n",
321
- " print(f\" ❌ transformers failed: {e}\")\n",
322
- " print(f\" Attempting detailed diagnosis...\")\n",
323
- " result = run_cmd([\n",
324
- " sys.executable, \"-c\",\n",
325
- " \"import transformers; print(transformers.__version__)\"\n",
326
- " ], capture=True)\n",
327
- " print(f\" Output: {result.stdout}\")\n",
328
- " print(f\" Error: {result.stderr}\")\n",
329
- "\n",
330
- " '''\n",
331
- " # LightGlue\n",
332
- " print(\"\\n🔍 Testing LightGlue...\")\n",
333
- " try:\n",
334
- " from lightglue import LightGlue, ALIKED\n",
335
- " print(f\" ✓ LightGlue: OK\")\n",
336
- " print(f\" ✓ ALIKED: OK\")\n",
337
- " except Exception as e:\n",
338
- " print(f\" ❌ LightGlue failed: {e}\")\n",
339
- " print(f\" Attempting detailed diagnosis...\")\n",
340
- " result = run_cmd([\n",
341
- " sys.executable, \"-c\",\n",
342
- " \"from lightglue import LightGlue\"\n",
343
- " ], capture=True)\n",
344
- " print(f\" Output: {result.stdout}\")\n",
345
- " print(f\" Error: {result.stderr}\")\n",
346
- " '''\n",
347
- "\n",
348
- " # pycolmap\n",
349
- " print(\"\\n🔍 Testing pycolmap...\")\n",
350
- " try:\n",
351
- " import pycolmap\n",
352
- " print(f\" ✓ pycolmap: OK\")\n",
353
- " except Exception as e:\n",
354
- " print(f\" ❌ pycolmap failed: {e}\")\n",
355
- "\n",
356
- " # kornia\n",
357
- " print(\"\\n🔍 Testing kornia...\")\n",
358
- " try:\n",
359
- " import kornia\n",
360
- " print(f\" ✓ kornia: {kornia.__version__}\")\n",
361
- " except Exception as e:\n",
362
- " print(f\" ❌ kornia failed: {e}\")\n",
363
- "\n",
364
- " print(\"\\n\" + \"=\"*70)\n",
365
- " print(\"✅ SETUP COMPLETE\")\n",
366
- " print(\"=\"*70)\n",
367
- " print(f\"Working dir: {WORK_DIR}\")\n",
368
- "\n",
369
- " return WORK_DIR\n",
370
- "\n",
371
- "\n",
372
- "if __name__ == \"__main__\":\n",
373
- " setup_environment()"
374
- ]
375
- },
376
- {
377
- "cell_type": "code",
378
- "source": [
379
- "!nvcc --version\n",
380
- "import torch\n",
381
- "print(torch.__version__)\n",
382
- "print(torch.version.cuda)"
383
- ],
384
- "metadata": {
385
- "id": "Ev9PEUdtpEAx"
386
- },
387
- "id": "Ev9PEUdtpEAx",
388
- "execution_count": null,
389
- "outputs": []
390
- },
391
- {
392
- "cell_type": "code",
393
- "execution_count": null,
394
- "id": "b8690389",
395
- "metadata": {
396
- "execution": {
397
- "iopub.execute_input": "2026-01-10T18:22:43.739411Z",
398
- "iopub.status.busy": "2026-01-10T18:22:43.738855Z",
399
- "iopub.status.idle": "2026-01-10T18:22:43.755664Z",
400
- "shell.execute_reply": "2026-01-10T18:22:43.754865Z"
401
- },
402
- "papermill": {
403
- "duration": 0.027297,
404
- "end_time": "2026-01-10T18:22:43.756758",
405
- "exception": false,
406
- "start_time": "2026-01-10T18:22:43.729461",
407
- "status": "completed"
408
- },
409
- "tags": [],
410
- "id": "b8690389"
411
- },
412
- "outputs": [],
413
- "source": [
414
- "import os\n",
415
- "import glob\n",
416
- "import cv2\n",
417
- "import numpy as np\n",
418
- "from PIL import Image\n",
419
- "\n",
420
- "# =========================================================\n",
421
- "# Utility: aspect ratio preserved + black padding\n",
422
- "# =========================================================\n",
423
- "\n",
424
- "def normalize_image_sizes_biplet(input_dir, output_dir=None, size=1024, max_images=None):\n",
425
- " \"\"\"\n",
426
- " Generates two square crops (Left & Right or Top & Bottom)\n",
427
- " from each image in a directory and returns the output directory\n",
428
- " and the list of generated file paths.\n",
429
- "\n",
430
- " Args:\n",
431
- " input_dir: Input directory containing source images\n",
432
- " output_dir: Output directory for processed images\n",
433
- " size: Target square size (default: 1024)\n",
434
- " max_images: Maximum number of SOURCE images to process (default: None = all images)\n",
435
- " \"\"\"\n",
436
- " if output_dir is None:\n",
437
- " output_dir = 'output/images_biplet'\n",
438
- " os.makedirs(output_dir, exist_ok=True)\n",
439
- "\n",
440
- " print(f\"--- Step 1: Biplet-Square Normalization ---\")\n",
441
- " print(f\"Generating 2 cropped squares (Left/Right or Top/Bottom) for each image...\")\n",
442
- " print()\n",
443
- "\n",
444
- " generated_paths = []\n",
445
- " converted_count = 0\n",
446
- " size_stats = {}\n",
447
- "\n",
448
- " # Sort for consistent processing order\n",
449
- " image_files = sorted([f for f in os.listdir(input_dir)\n",
450
- " if f.lower().endswith(('.jpg', '.jpeg', '.png'))])\n",
451
- "\n",
452
- " # ★ max_images で元画像数を制限\n",
453
- " if max_images is not None:\n",
454
- " image_files = image_files[:max_images]\n",
455
- " print(f\"Processing limited to {max_images} source images (will generate {max_images * 2} cropped images)\")\n",
456
- "\n",
457
- " for img_file in image_files:\n",
458
- " input_path = os.path.join(input_dir, img_file)\n",
459
- " try:\n",
460
- " img = Image.open(input_path)\n",
461
- " original_size = img.size\n",
462
- "\n",
463
- " # Tracking original aspect ratios\n",
464
- " size_key = f\"{original_size[0]}x{original_size[1]}\"\n",
465
- " size_stats[size_key] = size_stats.get(size_key, 0) + 1\n",
466
- "\n",
467
- " # Generate 2 crops using the helper function\n",
468
- " crops = generate_two_crops(img, size)\n",
469
- " base_name, ext = os.path.splitext(img_file)\n",
470
- "\n",
471
- " for mode, cropped_img in crops.items():\n",
472
- " output_path = os.path.join(output_dir, f\"{base_name}_{mode}{ext}\")\n",
473
- " cropped_img.save(output_path, quality=95)\n",
474
- " generated_paths.append(output_path)\n",
475
- "\n",
476
- " converted_count += 1\n",
477
- " print(f\" ✓ {img_file}: {original_size} → 2 square images generated\")\n",
478
- "\n",
479
- " except Exception as e:\n",
480
- " print(f\" ✗ Error processing {img_file}: {e}\")\n",
481
- "\n",
482
- " print(f\"\\nProcessing complete: {converted_count} source images processed\")\n",
483
- " print(f\"Total output images: {len(generated_paths)}\")\n",
484
- " print(f\"Original size distribution: {size_stats}\")\n",
485
- "\n",
486
- " return output_dir, generated_paths\n",
487
- "\n",
488
- "\n",
489
- "def generate_two_crops(img, size):\n",
490
- " \"\"\"\n",
491
- " Crops the image into a square and returns 2 variations\n",
492
- " (Left/Right for landscape, Top/Bottom for portrait).\n",
493
- " \"\"\"\n",
494
- " width, height = img.size\n",
495
- " crop_size = min(width, height)\n",
496
- " crops = {}\n",
497
- "\n",
498
- " if width > height:\n",
499
- " # Landscape → Left & Right\n",
500
- " positions = {\n",
501
- " 'left': 0,\n",
502
- " 'right': width - crop_size\n",
503
- " }\n",
504
- " for mode, x_offset in positions.items():\n",
505
- " box = (x_offset, 0, x_offset + crop_size, crop_size)\n",
506
- " crops[mode] = img.crop(box).resize(\n",
507
- " (size, size),\n",
508
- " Image.Resampling.LANCZOS\n",
509
- " )\n",
510
- "\n",
511
- " else:\n",
512
- " # Portrait or Square → Top & Bottom\n",
513
- " positions = {\n",
514
- " 'top': 0,\n",
515
- " 'bottom': height - crop_size\n",
516
- " }\n",
517
- " for mode, y_offset in positions.items():\n",
518
- " box = (0, y_offset, crop_size, y_offset + crop_size)\n",
519
- " crops[mode] = img.crop(box).resize(\n",
520
- " (size, size),\n",
521
- " Image.Resampling.LANCZOS\n",
522
- " )\n",
523
- "\n",
524
- " return crops\n"
525
- ]
526
- },
527
- {
528
- "cell_type": "code",
529
- "execution_count": null,
530
- "id": "7acc20b6",
531
- "metadata": {
532
- "execution": {
533
- "iopub.execute_input": "2026-01-10T18:22:43.772525Z",
534
- "iopub.status.busy": "2026-01-10T18:22:43.772303Z",
535
- "iopub.status.idle": "2026-01-10T18:22:43.790574Z",
536
- "shell.execute_reply": "2026-01-10T18:22:43.789515Z"
537
- },
538
- "papermill": {
539
- "duration": 0.027612,
540
- "end_time": "2026-01-10T18:22:43.791681",
541
- "exception": false,
542
- "start_time": "2026-01-10T18:22:43.764069",
543
- "status": "completed"
544
- },
545
- "tags": [],
546
- "id": "7acc20b6"
547
- },
548
- "outputs": [],
549
- "source": [
550
- "def run_colmap_reconstruction(image_dir, colmap_dir):\n",
551
- " \"\"\"Estimate camera poses and 3D point cloud with COLMAP\"\"\"\n",
552
- " print(\"Running SfM reconstruction with COLMAP...\")\n",
553
- "\n",
554
- " database_path = os.path.join(colmap_dir, \"database.db\")\n",
555
- " sparse_dir = os.path.join(colmap_dir, \"sparse\")\n",
556
- " os.makedirs(sparse_dir, exist_ok=True)\n",
557
- "\n",
558
- " # Set environment variable\n",
559
- " env = os.environ.copy()\n",
560
- " env['QT_QPA_PLATFORM'] = 'offscreen'\n",
561
- "\n",
562
- " # Feature extraction\n",
563
- " print(\"1/4: Extracting features...\")\n",
564
- " subprocess.run([\n",
565
- " 'colmap', 'feature_extractor',\n",
566
- " '--database_path', database_path,\n",
567
- " '--image_path', image_dir,\n",
568
- " '--ImageReader.single_camera', '1',\n",
569
- " '--ImageReader.camera_model', 'OPENCV',\n",
570
- " '--SiftExtraction.use_gpu', '0' # Use CPU\n",
571
- " ], check=True, env=env)\n",
572
- "\n",
573
- " # Feature matching\n",
574
- " print(\"2/4: Matching features...\")\n",
575
- " subprocess.run([\n",
576
- " 'colmap', 'exhaustive_matcher', # Use sequential_matcher instead of exhaustive_matcher\n",
577
- " '--database_path', database_path,\n",
578
- " '--SiftMatching.use_gpu', '0' # Use CPU\n",
579
- " ], check=True, env=env)\n",
580
- "\n",
581
- " # Sparse reconstruction\n",
582
- " print(\"3/4: Sparse reconstruction...\")\n",
583
- " subprocess.run([\n",
584
- " 'colmap', 'mapper',\n",
585
- " '--database_path', database_path,\n",
586
- " '--image_path', image_dir,\n",
587
- " '--output_path', sparse_dir,\n",
588
- " '--Mapper.ba_global_max_num_iterations', '20', # Speed up\n",
589
- " '--Mapper.ba_local_max_num_iterations', '10'\n",
590
- " ], check=True, env=env)\n",
591
- "\n",
592
- " # Export to text format\n",
593
- " print(\"4/4: Exporting to text format...\")\n",
594
- " model_dir = os.path.join(sparse_dir, '0')\n",
595
- " if not os.path.exists(model_dir):\n",
596
- " # Use the first model found\n",
597
- " subdirs = [d for d in os.listdir(sparse_dir) if os.path.isdir(os.path.join(sparse_dir, d))]\n",
598
- " if subdirs:\n",
599
- " model_dir = os.path.join(sparse_dir, subdirs[0])\n",
600
- " else:\n",
601
- " raise FileNotFoundError(\"COLMAP reconstruction failed\")\n",
602
- "\n",
603
- " subprocess.run([\n",
604
- " 'colmap', 'model_converter',\n",
605
- " '--input_path', model_dir,\n",
606
- " '--output_path', model_dir,\n",
607
- " '--output_type', 'TXT'\n",
608
- " ], check=True, env=env)\n",
609
- "\n",
610
- " print(f\"COLMAP reconstruction complete: {model_dir}\")\n",
611
- " return model_dir\n",
612
- "\n",
613
- "\n",
614
- "def convert_cameras_to_pinhole(input_file, output_file):\n",
615
- " \"\"\"Convert camera model to PINHOLE format\"\"\"\n",
616
- " print(f\"Reading camera file: {input_file}\")\n",
617
- "\n",
618
- " with open(input_file, 'r') as f:\n",
619
- " lines = f.readlines()\n",
620
- "\n",
621
- " converted_count = 0\n",
622
- " with open(output_file, 'w') as f:\n",
623
- " for line in lines:\n",
624
- " if line.startswith('#') or line.strip() == '':\n",
625
- " f.write(line)\n",
626
- " else:\n",
627
- " parts = line.strip().split()\n",
628
- " if len(parts) >= 4:\n",
629
- " cam_id = parts[0]\n",
630
- " model = parts[1]\n",
631
- " width = parts[2]\n",
632
- " height = parts[3]\n",
633
- " params = parts[4:]\n",
634
- "\n",
635
- " # Convert to PINHOLE format\n",
636
- " if model == \"PINHOLE\":\n",
637
- " f.write(line)\n",
638
- " elif model == \"OPENCV\":\n",
639
- " # OPENCV: fx, fy, cx, cy, k1, k2, p1, p2\n",
640
- " fx = params[0]\n",
641
- " fy = params[1]\n",
642
- " cx = params[2]\n",
643
- " cy = params[3]\n",
644
- " f.write(f\"{cam_id} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\\n\")\n",
645
- " converted_count += 1\n",
646
- " else:\n",
647
- " # Convert other models too\n",
648
- " fx = fy = max(float(width), float(height))\n",
649
- " cx = float(width) / 2\n",
650
- " cy = float(height) / 2\n",
651
- " f.write(f\"{cam_id} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\\n\")\n",
652
- " converted_count += 1\n",
653
- " else:\n",
654
- " f.write(line)\n",
655
- "\n",
656
- " print(f\"Converted {converted_count} cameras to PINHOLE format\")\n",
657
- "\n",
658
- "\n",
659
- "def prepare_gaussian_splatting_data(image_dir, colmap_model_dir):\n",
660
- " \"\"\"Prepare data for Gaussian Splatting\"\"\"\n",
661
- " print(\"Preparing data for Gaussian Splatting...\")\n",
662
- "\n",
663
- " data_dir = f\"{WORK_DIR}/data/video\"\n",
664
- " os.makedirs(f\"{data_dir}/sparse/0\", exist_ok=True)\n",
665
- " os.makedirs(f\"{data_dir}/images\", exist_ok=True)\n",
666
- "\n",
667
- " # Copy images\n",
668
- " print(\"Copying images...\")\n",
669
- " img_count = 0\n",
670
- " for img_file in os.listdir(image_dir):\n",
671
- " if img_file.lower().endswith(('.jpg', '.jpeg', '.png')):\n",
672
- " shutil.copy(\n",
673
- " os.path.join(image_dir, img_file),\n",
674
- " f\"{data_dir}/images/{img_file}\"\n",
675
- " )\n",
676
- " img_count += 1\n",
677
- " print(f\"Copied {img_count} images\")\n",
678
- "\n",
679
- " # Convert and copy camera file to PINHOLE format\n",
680
- " print(\"Converting camera model to PINHOLE format...\")\n",
681
- " convert_cameras_to_pinhole(\n",
682
- " os.path.join(colmap_model_dir, 'cameras.txt'),\n",
683
- " f\"{data_dir}/sparse/0/cameras.txt\"\n",
684
- " )\n",
685
- "\n",
686
- " # Copy other files\n",
687
- " for filename in ['images.txt', 'points3D.txt']:\n",
688
- " src = os.path.join(colmap_model_dir, filename)\n",
689
- " dst = f\"{data_dir}/sparse/0/{filename}\"\n",
690
- " if os.path.exists(src):\n",
691
- " shutil.copy(src, dst)\n",
692
- " print(f\"Copied {filename}\")\n",
693
- " else:\n",
694
- " print(f\"Warning: {filename} not found\")\n",
695
- "\n",
696
- " print(f\"Data preparation complete: {data_dir}\")\n",
697
- " return data_dir\n",
698
- "\n",
699
- "def run_colmap_reconstruction(image_dir, colmap_dir):\n",
700
- " \"\"\"Estimate camera poses and 3D point cloud with COLMAP\"\"\"\n",
701
- " print(\"Running SfM reconstruction with COLMAP...\")\n",
702
- "\n",
703
- " database_path = os.path.join(colmap_dir, \"database.db\")\n",
704
- " sparse_dir = os.path.join(colmap_dir, \"sparse\")\n",
705
- " os.makedirs(sparse_dir, exist_ok=True)\n",
706
- "\n",
707
- " # Set environment variable\n",
708
- " env = os.environ.copy()\n",
709
- " env['QT_QPA_PLATFORM'] = 'offscreen'\n",
710
- "\n",
711
- " # Feature extraction\n",
712
- " print(\"1/4: Extracting features...\")\n",
713
- " subprocess.run([\n",
714
- " 'colmap', 'feature_extractor',\n",
715
- " '--database_path', database_path,\n",
716
- " '--image_path', image_dir,\n",
717
- " '--ImageReader.single_camera', '1',\n",
718
- " '--ImageReader.camera_model', 'OPENCV',\n",
719
- " '--SiftExtraction.use_gpu', '0' # Use CPU\n",
720
- " ], check=True, env=env)\n",
721
- "\n",
722
- " # Feature matching\n",
723
- " print(\"2/4: Matching features...\")\n",
724
- " subprocess.run([\n",
725
- " 'colmap', 'exhaustive_matcher', # Use sequential_matcher instead of exhaustive_matcher\n",
726
- " '--database_path', database_path,\n",
727
- " '--SiftMatching.use_gpu', '0' # Use CPU\n",
728
- " ], check=True, env=env)\n",
729
- "\n",
730
- " # Sparse reconstruction\n",
731
- " print(\"3/4: Sparse reconstruction...\")\n",
732
- " subprocess.run([\n",
733
- " 'colmap', 'mapper',\n",
734
- " '--database_path', database_path,\n",
735
- " '--image_path', image_dir,\n",
736
- " '--output_path', sparse_dir,\n",
737
- " '--Mapper.ba_global_max_num_iterations', '20', # Speed up\n",
738
- " '--Mapper.ba_local_max_num_iterations', '10'\n",
739
- " ], check=True, env=env)\n",
740
- "\n",
741
- " # Export to text format\n",
742
- " print(\"4/4: Exporting to text format...\")\n",
743
- " model_dir = os.path.join(sparse_dir, '0')\n",
744
- " if not os.path.exists(model_dir):\n",
745
- " # Use the first model found\n",
746
- " subdirs = [d for d in os.listdir(sparse_dir) if os.path.isdir(os.path.join(sparse_dir, d))]\n",
747
- " if subdirs:\n",
748
- " model_dir = os.path.join(sparse_dir, subdirs[0])\n",
749
- " else:\n",
750
- " raise FileNotFoundError(\"COLMAP reconstruction failed\")\n",
751
- "\n",
752
- " subprocess.run([\n",
753
- " 'colmap', 'model_converter',\n",
754
- " '--input_path', model_dir,\n",
755
- " '--output_path', model_dir,\n",
756
- " '--output_type', 'TXT'\n",
757
- " ], check=True, env=env)\n",
758
- "\n",
759
- " print(f\"COLMAP reconstruction complete: {model_dir}\")\n",
760
- " return model_dir\n",
761
- "\n",
762
- "\n",
763
- "def convert_cameras_to_pinhole(input_file, output_file):\n",
764
- " \"\"\"Convert camera model to PINHOLE format\"\"\"\n",
765
- " print(f\"Reading camera file: {input_file}\")\n",
766
- "\n",
767
- " with open(input_file, 'r') as f:\n",
768
- " lines = f.readlines()\n",
769
- "\n",
770
- " converted_count = 0\n",
771
- " with open(output_file, 'w') as f:\n",
772
- " for line in lines:\n",
773
- " if line.startswith('#') or line.strip() == '':\n",
774
- " f.write(line)\n",
775
- " else:\n",
776
- " parts = line.strip().split()\n",
777
- " if len(parts) >= 4:\n",
778
- " cam_id = parts[0]\n",
779
- " model = parts[1]\n",
780
- " width = parts[2]\n",
781
- " height = parts[3]\n",
782
- " params = parts[4:]\n",
783
- "\n",
784
- " # Convert to PINHOLE format\n",
785
- " if model == \"PINHOLE\":\n",
786
- " f.write(line)\n",
787
- " elif model == \"OPENCV\":\n",
788
- " # OPENCV: fx, fy, cx, cy, k1, k2, p1, p2\n",
789
- " fx = params[0]\n",
790
- " fy = params[1]\n",
791
- " cx = params[2]\n",
792
- " cy = params[3]\n",
793
- " f.write(f\"{cam_id} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\\n\")\n",
794
- " converted_count += 1\n",
795
- " else:\n",
796
- " # Convert other models too\n",
797
- " fx = fy = max(float(width), float(height))\n",
798
- " cx = float(width) / 2\n",
799
- " cy = float(height) / 2\n",
800
- " f.write(f\"{cam_id} PINHOLE {width} {height} {fx} {fy} {cx} {cy}\\n\")\n",
801
- " converted_count += 1\n",
802
- " else:\n",
803
- " f.write(line)\n",
804
- "\n",
805
- " print(f\"Converted {converted_count} cameras to PINHOLE format\")\n",
806
- "\n",
807
- "\n",
808
- "def prepare_gaussian_splatting_data(image_dir, colmap_model_dir):\n",
809
- " \"\"\"Prepare data for Gaussian Splatting\"\"\"\n",
810
- " print(\"Preparing data for Gaussian Splatting...\")\n",
811
- "\n",
812
- " data_dir = f\"{WORK_DIR}/data/video\"\n",
813
- " os.makedirs(f\"{data_dir}/sparse/0\", exist_ok=True)\n",
814
- " os.makedirs(f\"{data_dir}/images\", exist_ok=True)\n",
815
- "\n",
816
- " # Copy images\n",
817
- " print(\"Copying images...\")\n",
818
- " img_count = 0\n",
819
- " for img_file in os.listdir(image_dir):\n",
820
- " if img_file.lower().endswith(('.jpg', '.jpeg', '.png')):\n",
821
- " shutil.copy(\n",
822
- " os.path.join(image_dir, img_file),\n",
823
- " f\"{data_dir}/images/{img_file}\"\n",
824
- " )\n",
825
- " img_count += 1\n",
826
- " print(f\"Copied {img_count} images\")\n",
827
- "\n",
828
- " # Convert and copy camera file to PINHOLE format\n",
829
- " print(\"Converting camera model to PINHOLE format...\")\n",
830
- " convert_cameras_to_pinhole(\n",
831
- " os.path.join(colmap_model_dir, 'cameras.txt'),\n",
832
- " f\"{data_dir}/sparse/0/cameras.txt\"\n",
833
- " )\n",
834
- "\n",
835
- " # Copy other files\n",
836
- " for filename in ['images.txt', 'points3D.txt']:\n",
837
- " src = os.path.join(colmap_model_dir, filename)\n",
838
- " dst = f\"{data_dir}/sparse/0/{filename}\"\n",
839
- " if os.path.exists(src):\n",
840
- " shutil.copy(src, dst)\n",
841
- " print(f\"Copied {filename}\")\n",
842
- " else:\n",
843
- " print(f\"Warning: {filename} not found\")\n",
844
- "\n",
845
- " print(f\"Data preparation complete: {data_dir}\")\n",
846
- " return data_dir\n",
847
- "\n",
848
- "\n",
849
- "\n",
850
- "###############################################################\n",
851
- "\n",
852
- "# 変更後 (2DGS) - 正則化パラメータを追加\n",
853
- "def train_gaussian_splatting(data_dir, iterations=7000,\n",
854
- " lambda_normal=0.05,\n",
855
- " lambda_distortion=0,\n",
856
- " depth_ratio=0):\n",
857
- " \"\"\"\n",
858
- " 2DGS用のトレーニング関数\n",
859
- "\n",
860
- " Args:\n",
861
- " lambda_normal: 法線一貫性の重み (デフォルト: 0.05)\n",
862
- " lambda_distortion: 深度歪みの重み (デフォルト: 0)\n",
863
- " depth_ratio: 0=平均深度, 1=中央値深度 (デフォルト: 0)\n",
864
- " \"\"\"\n",
865
- " model_path = f\"{WORK_DIR}/output/video\"\n",
866
- " cmd = [\n",
867
- " sys.executable, 'train.py',\n",
868
- " '-s', data_dir,\n",
869
- " '-m', model_path,\n",
870
- " '--iterations', str(iterations),\n",
871
- " '--lambda_normal', str(lambda_normal),\n",
872
- " '--lambda_distortion', str(lambda_distortion),\n",
873
- " '--depth_ratio', str(depth_ratio),\n",
874
- " '--eval'\n",
875
- " ]\n",
876
- " subprocess.run(cmd, cwd=WORK_DIR, check=True)\n",
877
- " return model_path\n",
878
- "\n",
879
- "\n",
880
- "\n",
881
- "# 2DGSではメッシュ抽出オプションが追加されています\n",
882
- "def render_video_and_mesh(model_path, output_video_path, iteration=7000,\n",
883
- " extract_mesh=True, unbounded=False, mesh_res=1024):\n",
884
- " \"\"\"\n",
885
- " 2DGS用のレンダリングとメッシュ抽出\n",
886
- "\n",
887
- " Args:\n",
888
- " extract_mesh: メッシュを抽出するか\n",
889
- " unbounded: 境界なしメッシュ抽出を使用するか\n",
890
- " mesh_res: メッシュ解像度\n",
891
- " \"\"\"\n",
892
- " # 通常のレンダリング\n",
893
- " cmd = [\n",
894
- " sys.executable, 'render.py',\n",
895
- " '-m', model_path,\n",
896
- " '--iteration', str(iteration)\n",
897
- " ]\n",
898
- "\n",
899
- " # メッシュ抽出オプション追加\n",
900
- " if extract_mesh:\n",
901
- " if unbounded:\n",
902
- " cmd.extend(['--unbounded', '--mesh_res', str(mesh_res)])\n",
903
- " cmd.extend(['--skip_test', '--skip_train'])\n",
904
- "\n",
905
- " subprocess.run(cmd, cwd=WORK_DIR, check=True)\n",
906
- "\n",
907
- " # Find the rendering directory\n",
908
- " possible_dirs = [\n",
909
- " f\"{model_path}/test/ours_{iteration}/renders\",\n",
910
- " f\"{model_path}/train/ours_{iteration}/renders\",\n",
911
- " ]\n",
912
- "\n",
913
- " render_dir = None\n",
914
- " for test_dir in possible_dirs:\n",
915
- " if os.path.exists(test_dir):\n",
916
- " render_dir = test_dir\n",
917
- " print(f\"Rendering directory found: {render_dir}\")\n",
918
- " break\n",
919
- "\n",
920
- " if render_dir and os.path.exists(render_dir):\n",
921
- " render_imgs = sorted([f for f in os.listdir(render_dir) if f.endswith('.png')])\n",
922
- "\n",
923
- " if render_imgs:\n",
924
- " print(f\"Found {len(render_imgs)} rendered images\")\n",
925
- "\n",
926
- " # Create video with ffmpeg\n",
927
- " subprocess.run([\n",
928
- " 'ffmpeg', '-y',\n",
929
- " '-framerate', '30',\n",
930
- " '-pattern_type', 'glob',\n",
931
- " '-i', f\"{render_dir}/*.png\",\n",
932
- " '-c:v', 'libx264',\n",
933
- " '-pix_fmt', 'yuv420p',\n",
934
- " '-crf', '18',\n",
935
- " output_video_path\n",
936
- " ], check=True)\n",
937
- "\n",
938
- " print(f\"Video saved: {output_video_path}\")\n",
939
- " return True\n",
940
- "\n",
941
- " print(\"Error: Rendering directory not found\")\n",
942
- " return False\n",
943
- "\n",
944
- "###############################################################\n",
945
- "\n",
946
- "\n",
947
- "def create_gif(video_path, gif_path):\n",
948
- " \"\"\"Create GIF from MP4\"\"\"\n",
949
- " print(\"Creating animated GIF...\")\n",
950
- "\n",
951
- " subprocess.run([\n",
952
- " 'ffmpeg', '-y',\n",
953
- " '-i', video_path,\n",
954
- " '-vf', 'setpts=8*PTS,fps=10,scale=720:-1:flags=lanczos',\n",
955
- " '-loop', '0',\n",
956
- " gif_path\n",
957
- " ], check=True)\n",
958
- "\n",
959
- " if os.path.exists(gif_path):\n",
960
- " size_mb = os.path.getsize(gif_path) / (1024 * 1024)\n",
961
- " print(f\"GIF creation complete: {gif_path} ({size_mb:.2f} MB)\")\n",
962
- " return True\n",
963
- "\n",
964
- " return False"
965
- ]
966
- },
967
- {
968
- "cell_type": "code",
969
- "source": [],
970
- "metadata": {
971
- "id": "YtqhBP4T3jEH"
972
- },
973
- "id": "YtqhBP4T3jEH",
974
- "execution_count": null,
975
- "outputs": []
976
- },
977
- {
978
- "cell_type": "code",
979
- "source": [
980
- "def main_pipeline(image_dir, output_dir, square_size=1024, max_images=100):\n",
981
- " \"\"\"Main execution function\"\"\"\n",
982
- " try:\n",
983
- " # Step 1: 画像の正規化と前処理\n",
984
- " print(\"=\"*60)\n",
985
- " print(\"Step 1: Normalizing and preprocessing images\")\n",
986
- " print(\"=\"*60)\n",
987
- "\n",
988
- " frame_dir = os.path.join(COLMAP_DIR, \"images\")\n",
989
- " os.makedirs(frame_dir, exist_ok=True)\n",
990
- "\n",
991
- " # 画像を正規化して直接COLMAPのディレクトリに保存\n",
992
- " num_processed = normalize_image_sizes_biplet(\n",
993
- " input_dir=image_dir,\n",
994
- " output_dir=frame_dir, # 直接colmap/imagesに保存\n",
995
- " size=square_size,\n",
996
- " max_images=max_images\n",
997
- " )\n",
998
- "\n",
999
- " print(f\"Processed {num_processed} images\")\n",
1000
- "\n",
1001
- " # Step 2: Estimate Camera Info with COLMAP\n",
1002
- " print(\"=\"*60)\n",
1003
- " print(\"Step 2: Running COLMAP reconstruction\")\n",
1004
- " print(\"=\"*60)\n",
1005
- " colmap_model_dir = run_colmap_reconstruction(frame_dir, COLMAP_DIR)\n",
1006
- "\n",
1007
- " # Step 3: Prepare Data for Gaussian Splatting\n",
1008
- " print(\"=\"*60)\n",
1009
- " print(\"Step 3: Preparing Gaussian Splatting data\")\n",
1010
- " print(\"=\"*60)\n",
1011
- " data_dir = prepare_gaussian_splatting_data(frame_dir, colmap_model_dir)\n",
1012
- "\n",
1013
- " # Step 4: Train Model\n",
1014
- " print(\"=\"*60)\n",
1015
- " print(\"Step 4: Training Gaussian Splatting model\")\n",
1016
- " print(\"=\"*60)\n",
1017
- " # 修正: frame_dir → data_dir\n",
1018
- " model_path = train_gaussian_splatting(\n",
1019
- " data_dir, # ← ここを修正!\n",
1020
- " iterations=1000,\n",
1021
- " lambda_normal=0.05,\n",
1022
- " lambda_distortion=0,\n",
1023
- " depth_ratio=0\n",
1024
- " )\n",
1025
- "\n",
1026
- " print(f\"Model trained at: {model_path}\")\n",
1027
- "\n",
1028
- " # Step 5: Render Video\n",
1029
- " print(\"=\"*60)\n",
1030
- " print(\"Step 5: Rendering video\")\n",
1031
- " print(\"=\"*60)\n",
1032
- " os.makedirs(OUTPUT_DIR, exist_ok=True)\n",
1033
- " output_video = os.path.join(OUTPUT_DIR, \"gaussian_splatting_video.mp4\")\n",
1034
- "\n",
1035
- " # 修正: output_video_path → output_video\n",
1036
- " success = render_video_and_mesh(\n",
1037
- " model_path,\n",
1038
- " output_video, # ← ここを修正!\n",
1039
- " iteration=1000,\n",
1040
- " extract_mesh=True, # メッシュ抽出を有効化\n",
1041
- " unbounded=True, # 境界なしメッシュ(推奨)\n",
1042
- " mesh_res=1024\n",
1043
- " )\n",
1044
- "\n",
1045
- " if success:\n",
1046
- " print(\"=\"*60)\n",
1047
- " print(f\"Success! Video generation complete: {output_video}\")\n",
1048
- " print(\"=\"*60)\n",
1049
- "\n",
1050
- " # Create GIF\n",
1051
- " output_gif = os.path.join(OUTPUT_DIR, \"gaussian_splatting_video.gif\")\n",
1052
- " create_gif(output_video, output_gif)\n",
1053
- "\n",
1054
- " # Display result\n",
1055
- " from IPython.display import Image, display\n",
1056
- " display(Image(open(output_gif, 'rb').read()))\n",
1057
- "\n",
1058
- " return output_video, output_gif\n",
1059
- " else:\n",
1060
- " print(\"Warning: Rendering complete, but video was not generated\")\n",
1061
- " return None, None\n",
1062
- "\n",
1063
- " except Exception as e:\n",
1064
- " print(f\"Error: {str(e)}\")\n",
1065
- " import traceback\n",
1066
- " traceback.print_exc()\n",
1067
- " return None, None\n",
1068
- "\n",
1069
- "\n",
1070
- "if __name__ == \"__main__\":\n",
1071
- " IMAGE_DIR = \"/content/drive/MyDrive/your_folder/fountain100\"\n",
1072
- " OUTPUT_DIR = \"/content/output\"\n",
1073
- " COLMAP_DIR = \"/content/colmap_workspace\"\n",
1074
- "\n",
1075
- " video_path, gif_path = main_pipeline(\n",
1076
- " image_dir=IMAGE_DIR,\n",
1077
- " output_dir=OUTPUT_DIR,\n",
1078
- " square_size=1024,\n",
1079
- " max_images=20\n",
1080
- " )\n",
1081
- "\n",
1082
- " if video_path:\n",
1083
- " print(f\"\\n✅ Success!\")\n",
1084
- " print(f\"Video: {video_path}\")\n",
1085
- " print(f\"GIF: {gif_path}\")\n",
1086
- " else:\n",
1087
- " print(\"\\n❌ Pipeline failed\")"
1088
- ],
1089
- "metadata": {
1090
- "colab": {
1091
- "base_uri": "https://localhost:8080/",
1092
- "height": 1000
1093
- },
1094
- "id": "fya3kv62NXM-",
1095
- "outputId": "a38520bc-2246-426f-e65a-3cdfcd67082b"
1096
- },
1097
- "id": "fya3kv62NXM-",
1098
- "execution_count": 10,
1099
- "outputs": [
1100
- {
1101
- "output_type": "stream",
1102
- "name": "stdout",
1103
- "text": [
1104
- "============================================================\n",
1105
- "Step 1: Normalizing and preprocessing images\n",
1106
- "============================================================\n",
1107
- "--- Step 1: Biplet-Square Normalization ---\n",
1108
- "Generating 2 cropped squares (Left/Right or Top/Bottom) for each image...\n",
1109
- "\n",
1110
- "Processing limited to 20 source images (will generate 40 cropped images)\n",
1111
- " ✓ image_101.jpeg: (1440, 1920) → 2 square images generated\n",
1112
- " ✓ image_102.jpeg: (1440, 1920) → 2 square images generated\n",
1113
- " ✓ image_103.jpeg: (1440, 1920) → 2 square images generated\n",
1114
- " ✓ image_104.jpeg: (1440, 1920) → 2 square images generated\n",
1115
- " ✓ image_105.jpeg: (1440, 1920) → 2 square images generated\n",
1116
- " ✓ image_106.jpeg: (1440, 1920) → 2 square images generated\n",
1117
- " ✓ image_107.jpeg: (1440, 1920) → 2 square images generated\n",
1118
- " ✓ image_108.jpeg: (1440, 1920) → 2 square images generated\n",
1119
- " ✓ image_109.jpeg: (1440, 1920) → 2 square images generated\n",
1120
- " ✓ image_110.jpeg: (1440, 1920) → 2 square images generated\n",
1121
- " ✓ image_111.jpeg: (1440, 1920) → 2 square images generated\n",
1122
- " ✓ image_112.jpeg: (1440, 1920) → 2 square images generated\n",
1123
- " ✓ image_113.jpeg: (1440, 1920) → 2 square images generated\n",
1124
- " ✓ image_114.jpeg: (1440, 1920) → 2 square images generated\n",
1125
- " ✓ image_115.jpeg: (1440, 1920) → 2 square images generated\n",
1126
- " ✓ image_116.jpeg: (1440, 1920) → 2 square images generated\n",
1127
- " ✓ image_117.jpeg: (1440, 1920) → 2 square images generated\n",
1128
- " ✓ image_118.jpeg: (1440, 1920) → 2 square images generated\n",
1129
- " ✓ image_119.jpeg: (1440, 1920) → 2 square images generated\n",
1130
- " ✓ image_120.jpeg: (1440, 1920) → 2 square images generated\n",
1131
- "\n",
1132
- "Processing complete: 20 source images processed\n",
1133
- "Total output images: 40\n",
1134
- "Original size distribution: {'1440x1920': 20}\n",
1135
- "Processed ('/content/colmap_workspace/images', ['/content/colmap_workspace/images/image_101_top.jpeg', '/content/colmap_workspace/images/image_101_bottom.jpeg', '/content/colmap_workspace/images/image_102_top.jpeg', '/content/colmap_workspace/images/image_102_bottom.jpeg', '/content/colmap_workspace/images/image_103_top.jpeg', '/content/colmap_workspace/images/image_103_bottom.jpeg', '/content/colmap_workspace/images/image_104_top.jpeg', '/content/colmap_workspace/images/image_104_bottom.jpeg', '/content/colmap_workspace/images/image_105_top.jpeg', '/content/colmap_workspace/images/image_105_bottom.jpeg', '/content/colmap_workspace/images/image_106_top.jpeg', '/content/colmap_workspace/images/image_106_bottom.jpeg', '/content/colmap_workspace/images/image_107_top.jpeg', '/content/colmap_workspace/images/image_107_bottom.jpeg', '/content/colmap_workspace/images/image_108_top.jpeg', '/content/colmap_workspace/images/image_108_bottom.jpeg', '/content/colmap_workspace/images/image_109_top.jpeg', '/content/colmap_workspace/images/image_109_bottom.jpeg', '/content/colmap_workspace/images/image_110_top.jpeg', '/content/colmap_workspace/images/image_110_bottom.jpeg', '/content/colmap_workspace/images/image_111_top.jpeg', '/content/colmap_workspace/images/image_111_bottom.jpeg', '/content/colmap_workspace/images/image_112_top.jpeg', '/content/colmap_workspace/images/image_112_bottom.jpeg', '/content/colmap_workspace/images/image_113_top.jpeg', '/content/colmap_workspace/images/image_113_bottom.jpeg', '/content/colmap_workspace/images/image_114_top.jpeg', '/content/colmap_workspace/images/image_114_bottom.jpeg', '/content/colmap_workspace/images/image_115_top.jpeg', '/content/colmap_workspace/images/image_115_bottom.jpeg', '/content/colmap_workspace/images/image_116_top.jpeg', '/content/colmap_workspace/images/image_116_bottom.jpeg', '/content/colmap_workspace/images/image_117_top.jpeg', '/content/colmap_workspace/images/image_117_bottom.jpeg', '/content/colmap_workspace/images/image_118_top.jpeg', '/content/colmap_workspace/images/image_118_bottom.jpeg', '/content/colmap_workspace/images/image_119_top.jpeg', '/content/colmap_workspace/images/image_119_bottom.jpeg', '/content/colmap_workspace/images/image_120_top.jpeg', '/content/colmap_workspace/images/image_120_bottom.jpeg']) images\n",
1136
- "============================================================\n",
1137
- "Step 2: Running COLMAP reconstruction\n",
1138
- "============================================================\n",
1139
- "Running SfM reconstruction with COLMAP...\n",
1140
- "1/4: Extracting features...\n",
1141
- "2/4: Matching features...\n"
1142
- ]
1143
- },
1144
- {
1145
- "output_type": "error",
1146
- "ename": "KeyboardInterrupt",
1147
- "evalue": "",
1148
- "traceback": [
1149
- "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
1150
- "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
1151
- "\u001b[0;32m/tmp/ipython-input-3712511575.py\u001b[0m in \u001b[0;36m<cell line: 0>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[0mCOLMAP_DIR\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m\"/content/colmap_workspace\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 95\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 96\u001b[0;31m video_path, gif_path = main_pipeline(\n\u001b[0m\u001b[1;32m 97\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 98\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",
1152
- "\u001b[0;32m/tmp/ipython-input-3712511575.py\u001b[0m in \u001b[0;36mmain_pipeline\u001b[0;34m(image_dir, output_dir, square_size, max_images)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"Step 2: Running COLMAP reconstruction\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 25\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"=\"\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0;36m60\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 26\u001b[0;31m \u001b[0mcolmap_model_dir\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrun_colmap_reconstruction\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mframe_dir\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mCOLMAP_DIR\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 27\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 28\u001b[0m \u001b[0;31m# Step 3: Prepare Data for Gaussian Splatting\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1153
- "\u001b[0;32m/tmp/ipython-input-3503205118.py\u001b[0m in \u001b[0;36mrun_colmap_reconstruction\u001b[0;34m(image_dir, colmap_dir)\u001b[0m\n\u001b[1;32m 173\u001b[0m \u001b[0;31m# Feature matching\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 174\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"2/4: Matching features...\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 175\u001b[0;31m subprocess.run([\n\u001b[0m\u001b[1;32m 176\u001b[0m \u001b[0;34m'colmap'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m'exhaustive_matcher'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# Use sequential_matcher instead of exhaustive_matcher\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 177\u001b[0m \u001b[0;34m'--database_path'\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdatabase_path\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1154
- "\u001b[0;32m/usr/lib/python3.12/subprocess.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(input, capture_output, timeout, check, *popenargs, **kwargs)\u001b[0m\n\u001b[1;32m 548\u001b[0m \u001b[0;32mwith\u001b[0m \u001b[0mPopen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0mpopenargs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mprocess\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 549\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 550\u001b[0;31m \u001b[0mstdout\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstderr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mprocess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcommunicate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0minput\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\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 551\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mTimeoutExpired\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0mexc\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 552\u001b[0m \u001b[0mprocess\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mkill\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",
1155
- "\u001b[0;32m/usr/lib/python3.12/subprocess.py\u001b[0m in \u001b[0;36mcommunicate\u001b[0;34m(self, input, timeout)\u001b[0m\n\u001b[1;32m 1199\u001b[0m \u001b[0mstderr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstderr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mread\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 1200\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mstderr\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mclose\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-> 1201\u001b[0;31m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwait\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 1202\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 1203\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mtimeout\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1156
- "\u001b[0;32m/usr/lib/python3.12/subprocess.py\u001b[0m in \u001b[0;36mwait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 1262\u001b[0m \u001b[0mendtime\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_time\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m+\u001b[0m \u001b[0mtimeout\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1263\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1264\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_wait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mtimeout\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtimeout\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 1265\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyboardInterrupt\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1266\u001b[0m \u001b[0;31m# https://bugs.python.org/issue25942\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1157
- "\u001b[0;32m/usr/lib/python3.12/subprocess.py\u001b[0m in \u001b[0;36m_wait\u001b[0;34m(self, timeout)\u001b[0m\n\u001b[1;32m 2051\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mreturncode\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2052\u001b[0m \u001b[0;32mbreak\u001b[0m \u001b[0;31m# Another thread waited.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2053\u001b[0;31m \u001b[0;34m(\u001b[0m\u001b[0mpid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msts\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_try_wait\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;36m0\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 2054\u001b[0m \u001b[0;31m# Check the pid and loop as waitpid has been known to\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2055\u001b[0m \u001b[0;31m# return 0 even without WNOHANG in odd situations.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1158
- "\u001b[0;32m/usr/lib/python3.12/subprocess.py\u001b[0m in \u001b[0;36m_try_wait\u001b[0;34m(self, wait_flags)\u001b[0m\n\u001b[1;32m 2009\u001b[0m \u001b[0;34m\"\"\"All callers to this function MUST hold self._waitpid_lock.\"\"\"\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2010\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2011\u001b[0;31m \u001b[0;34m(\u001b[0m\u001b[0mpid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0msts\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mos\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mwaitpid\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpid\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mwait_flags\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 2012\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mChildProcessError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2013\u001b[0m \u001b[0;31m# This happens if SIGCLD is set to be ignored or waiting\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
1159
- "\u001b[0;31mKeyboardInterrupt\u001b[0m: "
1160
- ]
1161
- }
1162
- ]
1163
- },
1164
- {
1165
- "cell_type": "markdown",
1166
- "id": "e17ec719",
1167
- "metadata": {
1168
- "papermill": {
1169
- "duration": 0.49801,
1170
- "end_time": "2026-01-11T00:00:18.165833",
1171
- "exception": false,
1172
- "start_time": "2026-01-11T00:00:17.667823",
1173
- "status": "completed"
1174
- },
1175
- "tags": [],
1176
- "id": "e17ec719"
1177
- },
1178
- "source": []
1179
- },
1180
- {
1181
- "cell_type": "markdown",
1182
- "id": "38b3974c",
1183
- "metadata": {
1184
- "papermill": {
1185
- "duration": 0.427583,
1186
- "end_time": "2026-01-11T00:00:19.008387",
1187
- "exception": false,
1188
- "start_time": "2026-01-11T00:00:18.580804",
1189
- "status": "completed"
1190
- },
1191
- "tags": [],
1192
- "id": "38b3974c"
1193
- },
1194
- "source": []
1195
- }
1196
- ],
1197
- "metadata": {
1198
- "kaggle": {
1199
- "accelerator": "nvidiaTeslaT4",
1200
- "dataSources": [
1201
- {
1202
- "databundleVersionId": 5447706,
1203
- "sourceId": 49349,
1204
- "sourceType": "competition"
1205
- },
1206
- {
1207
- "datasetId": 1429416,
1208
- "sourceId": 14451718,
1209
- "sourceType": "datasetVersion"
1210
- }
1211
- ],
1212
- "dockerImageVersionId": 31090,
1213
- "isGpuEnabled": true,
1214
- "isInternetEnabled": true,
1215
- "language": "python",
1216
- "sourceType": "notebook"
1217
- },
1218
- "kernelspec": {
1219
- "display_name": "Python 3",
1220
- "name": "python3"
1221
- },
1222
- "language_info": {
1223
- "codemirror_mode": {
1224
- "name": "ipython",
1225
- "version": 3
1226
- },
1227
- "file_extension": ".py",
1228
- "mimetype": "text/x-python",
1229
- "name": "python",
1230
- "nbconvert_exporter": "python",
1231
- "pygments_lexer": "ipython3",
1232
- "version": "3.11.13"
1233
- },
1234
- "papermill": {
1235
- "default_parameters": {},
1236
- "duration": 20573.990788,
1237
- "end_time": "2026-01-11T00:00:22.081506",
1238
- "environment_variables": {},
1239
- "exception": null,
1240
- "input_path": "__notebook__.ipynb",
1241
- "output_path": "__notebook__.ipynb",
1242
- "parameters": {},
1243
- "start_time": "2026-01-10T18:17:28.090718",
1244
- "version": "2.6.0"
1245
- },
1246
- "colab": {
1247
- "provenance": [],
1248
- "gpuType": "T4"
1249
- },
1250
- "accelerator": "GPU"
1251
- },
1252
- "nbformat": 4,
1253
- "nbformat_minor": 5
1254
- }