Datasets:
Golden MVS Data — process & provenance note
For: a future Claude (or human) picking this up. This explains what the
output is, how it was produced, and how to use it. It is grounded in the
actual run logs in logs/ and cuda_golden_data_task.md.
1. What this is
The CUDA golden dense-MVS reference for the macOS/Metal PatchMatch port
(Task 1 of cuda_golden_data_task.md). It is COLMAP's CUDA patch_match_stereo
output on the south-building scene (128 images), to be diffed against a
future Metal patch_match_stereo port within tolerance.
The MVS CUDA code (patch_match_cuda.cu) is identical to upstream, so this
upstream-COLMAP output is the correct reference.
2. Environment it was generated on
| Resource | Value |
|---|---|
| Platform | Google Colab |
| GPU | NVIDIA Tesla T4, 15 GB, 70 W cap, CUDA arch 75 |
| CPU | Intel Xeon @ 2.00 GHz, 2 vCPU (1 core × 2 threads) |
| RAM | 12 GiB |
| COLMAP | 4.0.4 (built with CUDA), /usr/local/bin/colmap |
| pycolmap | 4.0.4 (for reading depth maps) |
3. The pipeline (exactly what ran)
Standard, documented COLMAP dense CLI — see colmap_cuda_golden_data.ipynb:
image_undistorter # sparse SfM + images -> dense workspace (cap 2000 px)
↓
patch_match_stereo # CUDA dense MVS, geom_consistency=true (the GPU step)
↓ --PatchMatchStereo.geom_consistency true (NO max_image_size: runs at
↓ undistorted resolution = default -1)
stereo_fusion # geometric depth/normal maps -> fused.ply
--input_type geometric
The notebook is idempotent: each cell skips when its output already exists, so it survives a Colab disconnect and can be re-run cheaply.
Notes / gotchas baked into the notebook
- Fusion bug (fixed). An earlier template chained
stereo_fusionintopoisson_mesherwith a trailing\, givingbash: line 4: : command not foundand nofused.ply. Each CLI call is now its own statement. - Resolution.
patch_match_stereois run without--max_image_size(COLMAP default −1) to match how this golden set was produced. Undistortion already caps images atUNDISTORT_MAX_IMAGE_SIZE = 2000, so memory stays bounded. - The run here resumed an in-progress
patch_match_stereo; the notebook's skip guards then completed fusion and packaging.
4. Outputs (this bundle)
colmap_cuda_golden_data.ipynb # the executed, idempotent notebook
note.md # this file
golden_mvs/dense/
fused.ply # 93 MB, 3,609,743 fused points
stereo/depth_maps/ *.geometric.bin # 128 geometric depth maps (the reference)
stereo/normal_maps/ *.geometric.bin # 128 geometric normal maps
logs/ # undistort / patch_match / fusion logs
(The separate _full.zip also holds the 128 *.photometric.bin maps and
consistency graphs; usually not needed.)
Depth/normal map format — how to read them
COLMAP dense binary map: ASCII header width&height&channels& then
little-endian float32 in Fortran (column-major) order. Reader (matches
COLMAP scripts/python/read_write_dense.py::read_array, see notebook cell 8):
import numpy as np
def read_colmap_array(path):
with open(path, "rb") as fid:
hdr, amp = b"", 0
while amp < 3:
ch = fid.read(1); hdr += ch
if ch == b"&": amp += 1
w, h, c = (int(x) for x in hdr.decode().split("&")[:3])
data = np.fromfile(fid, np.float32)
return np.transpose(data.reshape((w, h, c), order="F"), (1, 0, 2)).squeeze()
Depth maps are H×W float32; 0 = invalid (ignore zeros). Normal maps are
H×W×3. Sanity sample (P1180141.JPG.geometric.bin): shape 1196×1600,
56.3 % valid, depth range 0.880 .. 8.956.
5. How to use on the Mac
Drop under golden_task/golden_mvs/south-building/. The future Metal MVS
validation compares its patch_match_stereo depth/normal maps against these
on overlapping valid pixels (ignore zeros), within tolerance. CUDA output is
itself an approximation — for accuracy (vs truth) prefer ETH3D/DTU real GT
(Task 3); use these golden maps as the "did I port the same algorithm
faithfully" diff.
6. Performance profile (measured from logs/)
Wall-clock for the full one-time generation on the T4 box:
| Stage | Wall time | Bound by | Notes |
|---|---|---|---|
image_undistorter |
~10 min | CPU (2 vCPU) | 128 images → dense workspace |
patch_match_stereo |
~86 min (11:25:52 → 12:52:12) | GPU | 128 views, photometric + geometric passes, 5 iterations each; ~1.0–1.4 s per CUDA sweep |
stereo_fusion |
~5.8 min | CPU (single thread) | 3,609,743 points |
| packaging (zip) | ~6 min | CPU + I/O | 4.7 GB full archive |
| Total | ≈ 1 h 48 m | — | one-time per session |
Peak resource usage during patch_match_stereo (observed via nvidia-smi
/ ps):
| Resource | Peak | Of budget | Comment |
|---|---|---|---|
| GPU utilization | 100 % | T4 | fully GPU-bound — the step the Mac cannot run |
| GPU memory | ~0.9 GB | / 15 GB | small; bounded by the 2000 px undistort cap |
| CPU | ~99 % of 1 thread | / 2 vCPU | host side single-threaded per view |
| RAM (RSS) | ~5.6 GB | / 12 GiB | comfortably within RAM |
| Disk | ~7.4 GB raw maps | / 236 GB | depth 1.9 GB + normals 5.5 GB; fused 93 MB |
Takeaways for re-running / scaling:
- The job is GPU-bound; a faster/larger GPU (e.g. A100) is the main lever. More vCPUs mainly speed undistort + fusion + zip, not the MVS step.
- T4 memory is not the bottleneck here (0.9 GB used). Raising
UNDISTORT_MAX_IMAGE_SIZEincreases both VRAM and time roughly with pixel count — the default 2000 keeps a 128-image scene to ~1.5 h. - Normal maps dominate disk (5.5 GB); the slim geometric reference is what the Mac side actually needs.