Yehe commited on
Commit
9ea7940
·
0 Parent(s):

Initial release of CommMatchBench (v1.0)

Browse files
.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Creative Commons Attribution 4.0 International (CC BY 4.0)
2
+
3
+ This dataset compilation ("CommMatchBench" / `Yehe/comm-match-bench`) is licensed under the
4
+ Creative Commons Attribution 4.0 International License (CC BY 4.0).
5
+
6
+ To view a full copy of this license, visit:
7
+ https://creativecommons.org/licenses/by/4.0/
8
+ https://creativecommons.org/licenses/by/4.0/legalcode
9
+
10
+ You are free to:
11
+ - Share — copy and redistribute the material in any medium or format for any purpose,
12
+ even commercially.
13
+ - Adapt — remix, transform, and build upon the material for any purpose,
14
+ even commercially.
15
+
16
+ Under the following terms:
17
+ - Attribution — You must give appropriate credit to BOTH this benchmark compilation AND
18
+ the original source dataset creators listed in NOTICE.md (and embedded in every row's
19
+ `source_dataset`, `source_creators`, `source_license`, `source_url`, and `modifications`
20
+ columns), provide a link to the CC BY 4.0 license, and indicate if changes were made.
21
+ You may do so in any reasonable manner, but not in any way that suggests the licensors
22
+ endorse you or your use.
23
+ - No additional restrictions — You may not apply legal terms or technological measures
24
+ that legally restrict others from doing anything the license permits.
25
+
26
+ All underlying source datasets included in this benchmark are independently licensed under
27
+ commercial-permissive, non-copyleft licenses:
28
+ - Core splits (`pose`, `homography`, `flow`, `stereo`): 100% CC BY 4.0 exclusively.
29
+ - `hardmatch_ccby` split: strictly filtered non-copyleft subset of HardMatch where every
30
+ image is verified Public Domain, CC0 1.0, or CC BY (2.0 / 2.5 / 3.0 / 4.0) with zero
31
+ ShareAlike (SA), zero Non-Commercial (NC), and zero GFDL assets; exact per-image author,
32
+ source URL, and license are preserved in every Parquet row.
33
+ See NOTICE.md for complete creator credits, citations, source URLs, and a full log of
34
+ modifications applied to each source dataset.
35
+
36
+ Note on accompanying evaluation code (`eval_comm_match_bench.py`):
37
+ The standalone evaluation script `eval_comm_match_bench.py` is dual-available under the
38
+ Apache License, Version 2.0 (SPDX-License-Identifier: Apache-2.0).
NOTICE.md ADDED
@@ -0,0 +1,108 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Attribution & Provenance Notice (`Yehe/comm-match-bench`)
2
+
3
+ **License:** Creative Commons Attribution 4.0 International ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/))
4
+
5
+ Every image, camera pose, optical flow field, and stereo disparity map in **CommMatchBench** (`Yehe/comm-match-bench`) is sourced **exclusively** from datasets released under the commercial-permissive **CC BY 4.0** license. Zero Non-Commercial (`NC`), zero ShareAlike (`SA`), zero copyleft, and zero unverified web-scraped datasets are included.
6
+
7
+ In compliance with **CC BY 4.0 Section 3(a)**, full attribution is provided below **and** embedded per-row inside every Parquet shard (`source_dataset`, `source_creators`, `source_license`, `source_url`, `modifications`).
8
+
9
+ > **Non-Endorsement Disclaimer:** The original authors and institutions listed below are the sole creators of their respective datasets and are **not affiliated with, nor do they endorse**, this derivative benchmark compilation or downstream commercial products built with it.
10
+
11
+ ---
12
+
13
+ ## Original Source Datasets, Creators, Licenses & Modifications
14
+
15
+ ### 1. TUM RGB-D SLAM Dataset and Benchmark (`tum_slam` + stress anchors)
16
+ - **Creators:** Jürgen Sturm, Nikolas Engelhard, Felix Endres, Wolfram Burgard, Daniel Cremers (Computer Vision Group, Technical University of Munich)
17
+ - **Original License:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
18
+ - **Official Source:** https://cvg.cit.tum.de/data/datasets/rgbd-dataset
19
+ - **Modifications Made:** Selected wide-baseline RGB frame pairs with synchronized ground-truth trajectories; converted relative poses to `(R_0to1, t_0to1)` with scaled intrinsics `(K0, K1)`; re-encoded RGB frames as JPEG (quality 95) inside Apache Parquet shards; selected anchor frames used to generate deterministic rotation, illumination, and projective stress warps in the `homography` split.
20
+ - **Citation:**
21
+ ```bibtex
22
+ @inproceedings{sturm2012benchmark,
23
+ author = {Sturm, J{\"u}rgen and Engelhard, Nikolas and Endres, Felix and Burgard, Wolfram and Cremers, Daniel},
24
+ title = {A Benchmark for the Evaluation of {RGB-D} {SLAM} Systems},
25
+ booktitle = {Proc. of the IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
26
+ year = {2012}
27
+ }
28
+ ```
29
+
30
+ ### 2. BlendedMVS (`bmvs_wide` + stress anchors)
31
+ - **Creators:** Yao Yao, Zixin Luo, Shiwei Li, Jingyang Zhang, Yufan Ren, Lei Zhou, Tian Fang, Long Quan (HKUST / Altizure)
32
+ - **Original License:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
33
+ - **Official Source:** https://github.com/YoYo000/BlendedMVS
34
+ - **Modifications Made:** Selected medium-to-wide-baseline co-visible image pairs across diverse scenes; resized images to max side 800 px with exact camera intrinsic matrix rescaling (`K0`, `K1`); computed relative camera transforms `(R_0to1, t_0to1)`; re-encoded RGB images as JPEG (quality 95) in Parquet; selected anchor frames used for deterministic warps in the `homography` split.
35
+ - **Citation:**
36
+ ```bibtex
37
+ @inproceedings{yao2020blendedmvs,
38
+ author = {Yao, Yao and Luo, Zixin and Li, Shiwei and Zhang, Jingyang and Ren, Yufan and Zhou, Lei and Fang, Tian and Quan, Long},
39
+ title = {{BlendedMVS}: A Large-scale Dataset for Generalized Multi-view Stereo Networks},
40
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
41
+ year = {2020}
42
+ }
43
+ ```
44
+
45
+ ### 3. UnCommon Objects in 3D — uCO3D (`uco3d_obj` + stress anchors)
46
+ - **Creators:** Xingchen Liu, Piyush Tayal, Jianyuan Wang, Jesus Zarzar, Tom Monnier, Konstantinos Tertikas, Jiali Duan, Antoine Toisoul, Jason Y. Zhang, Natalia Neverova, Andrea Vedaldi, Roman Shapovalov, David Novotny (Meta AI / Visual Geometry Group, University of Oxford)
47
+ - **Original License:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
48
+ - **Official Source:** https://github.com/facebookresearch/uco3d
49
+ - **Modifications Made:** Sampled multi-view wide-stride object pairs across 52 scenes; resized images to max side 800 px with exact camera intrinsic matrix rescaling (`K0`, `K1`); computed relative camera poses `(R_0to1, t_0to1)`; re-encoded RGB frames as JPEG (quality 95) in Parquet; selected anchor frames used for deterministic warps in the `homography` split.
50
+ - **Citation:**
51
+ ```bibtex
52
+ @inproceedings{liu2025uco3d,
53
+ author = {Liu, Xingchen and Tayal, Piyush and Wang, Jianyuan and Zarzar, Jesus and Monnier, Tom and Tertikas, Konstantinos and Duan, Jiali and Toisoul, Antoine and Zhang, Jason Y. and Neverova, Natalia and Vedaldi, Andrea and Shapovalov, Roman and Novotny, David},
54
+ title = {UnCommon Objects in {3D}},
55
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
56
+ pages = {14102--14113},
57
+ year = {2025}
58
+ }
59
+ ```
60
+
61
+ ### 4. TartanAir V1 & TartanAir V2 (`tartan_day`, `tartan_hard` + stress anchors)
62
+ - **Creators:** Wenshan Wang, Delong Zhu, Xiangwei Wang, Yaoyu Hu, Yuheng Qiu, Chen Wang, Yafei Hu, Ashish Kapoor, Sebastian Scherer (TartanAir V1); Manthan Patel, Fan Yang, Yuheng Qiu, Wenshan Wang, Sebastian Scherer et al. (TartanAir V2 / TartanGround, CMU AirLab)
63
+ - **Original License:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
64
+ - **Official Source:** https://tartanair.org/
65
+ - **Modifications Made:** Sampled non-stationary trajectory pairs across Easy/Day (`tartan_day`) and Hard/Night/Winter/Underwater/Adverse (`tartan_hard`) environments; converted NED poses to OpenCV camera frame (`R_0to1, t_0to1`) with exact pinhole intrinsics (`K0, K1`); re-encoded RGB frames as JPEG (quality 95) in Parquet; selected anchor frames used for deterministic warps in the `homography` split.
66
+ - **Citations:**
67
+ ```bibtex
68
+ @inproceedings{wang2020tartanair,
69
+ author = {Wang, Wenshan and Zhu, Delong and Wang, Xiangwei and Hu, Yaoyu and Qiu, Yuheng and Wang, Chen and Hu, Yafei and Kapoor, Ashish and Scherer, Sebastian},
70
+ title = {{TartanAir}: A Dataset to Push the Limits of Visual {SLAM}},
71
+ booktitle = {2020 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
72
+ year = {2020}
73
+ }
74
+ ```
75
+
76
+ ### 5. Spring: High-Resolution Scene Flow, Optical Flow & Stereo (`spring_flow`, `spring_stereo`)
77
+ - **Creators:** Lukas Mehl, Jenny Schmalfuss, Azin Jahedi, Yaroslava Nalivayko, Andrés Bruhn (University of Stuttgart); rendered from open-source 3D production assets of the Blender Open Movie *"Spring"* by Andy Goralczyk, Francesco Siddi, and the Blender Studio team (Blender Foundation)
78
+ - **Original License:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
79
+ - **Official Source:** https://spring-benchmark.org/ (and https://studio.blender.org/films/spring/)
80
+ - **Modifications Made:**
81
+ - Resized left/right RGB frames from `1920x1080` to `960x540` (0.5x area downsampling, JPEG quality 95).
82
+ - **`flow` split:** Chained 6 consecutive forward optical flow frames (`t -> t+6`), scaled by 0.5x to match `960x540`, verified against disocclusions via photometric consistency (`< 14` RGB MAE), and encoded exact dense target coordinates `(map_x, map_y, valid)` into lossless 16-bit 3-channel PNGs at `1/32 px` (`0.03125 px`) precision.
83
+ - **`stereo` split:** Subsampled and scaled left-view disparity by 0.5x, applied photometric half-occlusion verification (`< 14` RGB MAE), and encoded exact dense disparity + validity into lossless 16-bit PNGs at `1/64 px` (`0.015625 px`) precision.
84
+ - **Citation:**
85
+ ```bibtex
86
+ @inproceedings{mehl2023spring,
87
+ author = {Mehl, Lukas and Schmalfuss, Jenny and Jahedi, Azin and Nalivayko, Yaroslava and Bruhn, Andr{\'e}s},
88
+ title = {Spring: A High-Resolution High-Detail Dataset and Benchmark for Scene Flow, Optical Flow and Stereo},
89
+ booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
90
+ year = {2023}
91
+ }
92
+ ```
93
+
94
+ ### 6. HardMatch — Strictly Filtered Non-Copyleft Subset (`hardmatch_ccby`)
95
+ - **Benchmark Creators:** David Nordström, Johan Edstedt, Georg Bökman, Jonathan Astermark, Anders Heyden, Viktor Larsson, Mårten Wadenbäck, Michael Felsberg, Fredrik Kahl (Chalmers University of Technology, Linköping University, University of Amsterdam, Lund University)
96
+ - **Underlying Images:** Individual Wikimedia Commons photographers and contributors — **exact per-image author, file title, original Wikimedia Commons URL, license name, and license URL are preserved in every row** (`author_a`, `license_a`, `license_url_a`, `original_url_a`, `file_title_a`, and corresponding `*_b` columns).
97
+ - **Original License (Filtered Subset):** Strictly filtered to pairs where **both** images carry verified non-copyleft commercial-permissive licenses (**Public Domain**, **CC0 1.0**, **CC BY 2.0**, **CC BY 2.5**, **CC BY 3.0**, or **CC BY 4.0**) with empty Wikimedia `Restrictions` and at least 5 ground-truth correspondences. All `CC BY-SA`, `GFDL`, `FAL`, and restricted pairs from the original 1,000-pair release were **strictly excluded** (retaining 210 verified pairs across 81 topics). HardMatch evaluation code & annotations repository is licensed under **MIT**.
98
+ - **Official Source:** https://github.com/davnords/HardMatch
99
+ - **Modifications Made:** Filtered strictly by automated license audit to retain only non-copyleft (`Public Domain` / `CC0` / `CC BY 2.0–4.0`) pairs; packaged original `A_lr.jpg` / `B_lr.jpg` images, hand-annotated `corresp_lr.txt` correspondences, challenge tags, and per-image Wikimedia Commons attribution metadata into Apache Parquet shards across `fast` (36), `standard` (100), and `large` (210) tiers.
100
+ - **Citation:**
101
+ ```bibtex
102
+ @inproceedings{nordstrom2026loma,
103
+ title = {{LoMa}: Local Feature Matching Revisited},
104
+ author = {Nordstr{\"o}m, David and Edstedt, Johan and B{\"o}kman, Georg and Astermark, Jonathan and Heyden, Anders and Larsson, Viktor and Wadenb{\"a}ck, M{\aa}rten and Felsberg, Michael and Kahl, Fredrik},
105
+ booktitle = {Proceedings of the European Conference on Computer Vision (ECCV)},
106
+ year = {2026}
107
+ }
108
+ ```
README.md ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ license_link: https://creativecommons.org/licenses/by/4.0/
4
+ task_categories:
5
+ - image-feature-extraction
6
+ - depth-estimation
7
+ - object-detection
8
+ tags:
9
+ - computer-vision
10
+ - feature-matching
11
+ - local-features
12
+ - visual-localization
13
+ - relative-pose
14
+ - optical-flow
15
+ - stereo-matching
16
+ - image-retrieval
17
+ - homography
18
+ - commercial-friendly
19
+ - cc-by-4.0
20
+ pretty_name: CommMatchBench (Commercial-Permissive Multi-Task Visual Matching Benchmark)
21
+ size_categories:
22
+ - 1K<n<10K
23
+ configs:
24
+ - config_name: fast
25
+ data_files:
26
+ - split: pose
27
+ path: data/pose/fast-*.parquet
28
+ - split: homography
29
+ path: data/homography/fast-*.parquet
30
+ - split: flow
31
+ path: data/flow/fast-*.parquet
32
+ - split: stereo
33
+ path: data/stereo/fast-*.parquet
34
+ - split: hardmatch_ccby
35
+ path: data/hardmatch_ccby/fast-*.parquet
36
+ - config_name: standard
37
+ default: true
38
+ data_files:
39
+ - split: pose
40
+ path:
41
+ - data/pose/fast-*.parquet
42
+ - data/pose/standard_ext-*.parquet
43
+ - split: homography
44
+ path:
45
+ - data/homography/fast-*.parquet
46
+ - data/homography/standard_ext-*.parquet
47
+ - split: flow
48
+ path:
49
+ - data/flow/fast-*.parquet
50
+ - data/flow/standard_ext-*.parquet
51
+ - split: stereo
52
+ path:
53
+ - data/stereo/fast-*.parquet
54
+ - data/stereo/standard_ext-*.parquet
55
+ - split: hardmatch_ccby
56
+ path:
57
+ - data/hardmatch_ccby/fast-*.parquet
58
+ - data/hardmatch_ccby/standard_ext-*.parquet
59
+ - config_name: large
60
+ data_files:
61
+ - split: pose
62
+ path:
63
+ - data/pose/fast-*.parquet
64
+ - data/pose/standard_ext-*.parquet
65
+ - data/pose/large_ext-*.parquet
66
+ - split: homography
67
+ path:
68
+ - data/homography/fast-*.parquet
69
+ - data/homography/standard_ext-*.parquet
70
+ - data/homography/large_ext-*.parquet
71
+ - split: flow
72
+ path:
73
+ - data/flow/fast-*.parquet
74
+ - data/flow/standard_ext-*.parquet
75
+ - data/flow/large_ext-*.parquet
76
+ - split: stereo
77
+ path:
78
+ - data/stereo/fast-*.parquet
79
+ - data/stereo/standard_ext-*.parquet
80
+ - data/stereo/large_ext-*.parquet
81
+ - split: hardmatch_ccby
82
+ path:
83
+ - data/hardmatch_ccby/fast-*.parquet
84
+ - data/hardmatch_ccby/standard_ext-*.parquet
85
+ - data/hardmatch_ccby/large_ext-*.parquet
86
+ ---
87
+
88
+ # CommMatchBench (`Yehe/comm-match-bench`)
89
+
90
+ **A Strictly Commercial-Permissive, Non-Copyleft Multi-Task Benchmark for Visual Feature Detection, Description, Matching, and Retrieval.**
91
+
92
+ Standard visual-matching benchmarks (ScanNet, MegaDepth, ETH3D, 7-Scenes, KITTI, Map-Free, ARKitScenes, CO3Dv2) carry Non-Commercial (`NC`), ShareAlike (`SA`), or custom academic-only restrictions. **CommMatchBench** compiles **2,815 geometrically verified image pairs across 5 splits and 7 distinct computer-vision evaluation tasks**, sourced **exclusively** from commercial-permissive, non-copyleft licenses (**100% CC BY 4.0** for all core splits; **Public Domain / CC0 / CC BY 2.0–4.0** strictly filtered with zero `SA`/`NC`/`GFDL` for `hardmatch_ccby`).
93
+
94
+ Every single Parquet row embeds full provenance (`source_dataset`, `source_creators`, `source_license`, `source_url`, `modifications`), and [NOTICE.md](NOTICE.md) documents complete author attribution, official source URLs, BibTeX citations, and exact modifications in compliance with **CC BY 4.0 Section 3(a)**.
95
+
96
+ ---
97
+
98
+ ## Three Nested Evaluation Tiers (Zero Duplicated Storage)
99
+
100
+ All three configs share the exact same underlying shards (`fast` $\subset$ `standard` $\subset$ `large`):
101
+
102
+ | Split | Evaluation Task(s) | Source Dataset(s) | `fast` | `standard` (default) | `large` |
103
+ |---|---|---|---:|---:|---:|
104
+ | **`pose`** | **Task 1:** 3D Relative Pose (`AUC@5/10/20°`, `Epi@2px`)<br>**Task 6:** 1-vs-N Standalone Visual Retrieval (`R@1`, `R@5`, `MRR`) | TUM RGB-D, BlendedMVS, uCO3D, TartanAir V1 & V2 (`CC BY 4.0`) | **150** | **600** | **1,500** |
105
+ | **`homography`** | **Task 2:** Planar Stress Homography (`rot`, `illum`, `geom`, `AUC@3/5/10px`)<br>**Task 5:** Raw Detector Repeatability & Sub-Pixel Loc (`Rep@1/3px`, `MedLocPx`) | Deterministic warps derived strictly from `pose` `CC BY 4.0` anchors | **72** | **240** | **600** |
106
+ | **`flow`** | **Task 3:** Non-Rigid 6-Frame Dense Optical Flow (`MMA@3/5px`, Inliers) | Spring (`CC BY 4.0`, Blender Studio / Univ. Stuttgart) | **24** | **120** | **227** |
107
+ | **`stereo`** | **Task 4:** Dense Rectified Stereo Correspondence (`MMA@2/5px`, Inliers) | Spring (`CC BY 4.0`, Blender Studio / Univ. Stuttgart) | **24** | **120** | **278** |
108
+ | **`hardmatch_ccby`** | **Task 7:** Extreme Uncalibrated F-Matrix Correspondence (`mAA@10px`) | HardMatch (`davnords/HardMatch`, strictly filtered to `PD / CC0 / CC BY 2.0–4.0`, zero `SA`/`NC`/`GFDL`) | **36** | **100** | **210** |
109
+ | **TOTAL** | **7 Distinct CV Benchmark Tasks** | **6 Audited Commercial-Permissive Sources (601 unique split-scenes)** | **306** | **1,180** | **2,815** |
110
+
111
+ ---
112
+
113
+ ## Quick Start
114
+
115
+ ### Load with Hugging Face `datasets`
116
+ ```python
117
+ from datasets import load_dataset
118
+
119
+ # Choose tier: "fast" (306 pairs), "standard" (1,180 pairs, default), or "large" (2,815 pairs)
120
+ ds = load_dataset("Yehe/comm-match-bench", "fast")
121
+
122
+ row = ds["pose"][0]
123
+ img_a, img_b = row["image_a"], row["image_b"] # PIL.Image RGB
124
+ K0, K1 = row["K0"], row["K1"] # 3x3 flattened intrinsics
125
+ R_0to1, t_0to1 = row["R_0to1"], row["t_0to1"] # relative camera pose
126
+ print(row["domain"], row["source_dataset"], row["source_license"])
127
+ ```
128
+
129
+ ### Run the Standalone 7-Task Evaluation Script
130
+ Download [eval_comm_match_bench.py](eval_comm_match_bench.py) (Apache-2.0):
131
+ ```bash
132
+ pip install datasets opencv-contrib-python numpy scipy
133
+ python eval_comm_match_bench.py --tier fast --matcher rootsift_lowct
134
+ python eval_comm_match_bench.py --tier standard --matcher orb_r085 --out results.json
135
+ ```
136
+
137
+ ### Decoding Lossless 16-bit Dense Ground Truth (`flow` & `stereo`)
138
+ Dense `960x540` ground truth maps are stored as lossless 16-bit 3-channel PNGs (`cv2.IMREAD_UNCHANGED` BGR uint16):
139
+ - **`flow` (`flow_gt_png`):** `valid = arr[..., 0] > 0`, `map_y = arr[..., 1] / 32.0`, `map_x = arr[..., 2] / 32.0` (`1/32 px = 0.03125 px` precision; maps `(x, y)` in `image_a` to `(map_x[y, x], map_y[y, x])` in `image_b`).
140
+ - **`stereo` (`disp_gt_png`):** `valid = arr[..., 0] > 0`, `disp = arr[..., 2] / 64.0` (`1/64 px = 0.015625 px` precision; rectified correspondence is `x_b = x_a - disp[y, x]`, `y_b = y_a`).
141
+ - **`hardmatch_ccby` (`gt_corrs`):** flattened list of `4 * num_gt_corrs` floats `[xA, yA, xB, yB, ...]` in pixel coordinates of `image_a` and `image_b`.
142
+
143
+ ---
144
+
145
+ ## Source Datasets, Licenses & Full Attribution
146
+
147
+ All credit for the original imagery, trajectories, dense ground truth, and manual annotations belongs to the original authors and institutions below. Per **CC BY 4.0 Section 3(a)**, see [NOTICE.md](NOTICE.md) for full BibTeX citations, per-dataset creator lists, and the detailed modification log. **Original creators do not endorse this derivative compilation.**
148
+
149
+ | Source Dataset | Splits / Domains | Original License | Creators / Institutions | Official URL |
150
+ |---|---|---|---|---|
151
+ | **TUM RGB-D** | `pose` (`tum_slam`), `homography` anchors | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Sturm, Engelhard, Endres, Burgard, Cremers (TU Munich) | https://cvg.cit.tum.de/data/datasets/rgbd-dataset |
152
+ | **BlendedMVS** | `pose` (`bmvs_wide`), `homography` anchors | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Yao, Luo, Li, Zhang, Ren, Zhou, Fang, Quan (HKUST / Altizure) | https://github.com/YoYo000/BlendedMVS |
153
+ | **uCO3D** | `pose` (`uco3d_obj`), `homography` anchors | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Liu, Tayal, Wang, Zarzar, Monnier, Tertikas, Duan, Toisoul, Zhang, Neverova, Vedaldi, Shapovalov, Novotny (Meta AI / Oxford VGG) | https://github.com/facebookresearch/uco3d |
154
+ | **TartanAir V1 & V2** | `pose` (`tartan_day`, `tartan_hard`), `homography` anchors | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Wang, Zhu, Wang, Hu, Qiu, Wang, Hu, Kapoor, Patel, Scherer et al. (CMU AirLab) | https://tartanair.org/ |
155
+ | **Spring** | `flow` (`spring_flow`), `stereo` (`spring_stereo`) | [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) | Mehl, Schmalfuss, Jahedi, Nalivayko, Bruhn (Univ. Stuttgart); Blender Open Movie *"Spring"* by Andy Goralczyk, Francesco Siddi & Blender Studio | https://spring-benchmark.org/ |
156
+ | **HardMatch** *(filtered non-copyleft subset)* | `hardmatch_ccby` (210/1,000 pairs retained) | **Public Domain / CC0 / CC BY 2.0–4.0** (code MIT; all `CC BY-SA` / `GFDL` / `FAL` excluded; exact per-image author & license in every row) | Nordström, Edstedt, Bökman, Astermark, Heyden, Larsson, Wadenbäck, Felsberg, Kahl (ECCV 2026) + individual Wikimedia Commons photographers | https://github.com/davnords/HardMatch |
157
+
158
+ ### Automated License Verification
159
+ Every row across all 16 Parquet shards (`2,815` pairs) passed automated license auditing with **`0` forbidden license occurrences** (zero `NC`, zero `SA`, zero `ND`, zero `GFDL`, zero `FAL`, zero non-empty Wikimedia `Restrictions`).
160
+
161
+ ---
162
+
163
+ ## Reference Baselines (`fast` tier, `<= 2048` keypoints)
164
+
165
+ Standard open-source OpenCV reference baselines evaluated with `eval_comm_match_bench.py` (`Pose5` = mean Pose AUC@5° across 5 `pose` domains; `Hom3` = mean Homography AUC@5px across `rot/illum/geom`; `Flow` = Spring 6-frame MMA@3px; `Stereo` = Spring Stereo MMA@2px; `DetR3` = raw detector Repeatability@3px & median sub-pixel error; `RetR1` = 1-vs-150 global standalone visual retrieval Recall@1; `HM-CCBY` = `hardmatch_ccby` uncalibrated F-matrix `mAA@10px` across 36 pairs):
166
+
167
+ | Method | Bytes | Pose5 | Hom3 | Flow MMA@3 (Inl) | Stereo MMA@2 (Inl) | Det Rep@3 (`loc`) | 1-vs-150 Ret R@1 (MRR) | HM-CCBY `mAA@10` |
168
+ |---|---:|---:|---:|---:|---:|---:|---:|---:|
169
+ | `ORB-2048` (Hamming `r=0.85`) | 32 B | 0.166 | 0.779 | 0.907 (582) | 0.903 (697) | 0.410 (`0.50px`) | 0.580 (0.692) | 0.0795 |
170
+ | `BEBLID-256 + ORB` (`r=0.85`) | 32 B | 0.184 | 0.798 | 0.925 (557) | 0.934 (695) | 0.410 (`0.50px`) | 0.600 (0.701) | 0.0885 |
171
+ | `TEBLID-256 + ORB` (`r=0.85`) | 32 B | 0.186 | 0.799 | 0.926 (561) | 0.931 (706) | 0.410 (`0.50px`) | 0.600 (0.706) | 0.0828 |
172
+ | `AKAZE-2048` (`r=0.85`) | 61 B | 0.243 | 0.879 | 0.933 (535) | 0.946 (591) | **0.675** (`0.33px`) | **0.613** (**0.725**) | 0.1412 |
173
+ | `RootSIFT-LowCT` (`ct=0.01`, MNN `r=0.80`) | 512 B | **0.399** | **0.944** | **0.963** (928) | **0.975** (1058) | 0.544 (**`0.28px`**) | 0.593 (0.706) | **0.1666** |
174
+
175
+ ---
176
+
177
+ ## License
178
+
179
+ - **Dataset compilation & metadata:** [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) (see [LICENSE](LICENSE) and [NOTICE.md](NOTICE.md)).
180
+ - **Evaluation script (`eval_comm_match_bench.py`):** Apache License 2.0.
data/flow/fast-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ef225bff32a29e3520e94f5ddc4f9b7d317eeb6ec7fccc26b7c7305cd1ed6e52
3
+ size 21348444
data/flow/large_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e7fe50bc2afd76ee13192dab8453b5fa471f12967d454ae01c7b1f642608a5f
3
+ size 102367976
data/flow/standard_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8c7ccdc79d7aebf0f52133108b75bee40e09fe3c6c22480f83da5d5b0d1dfd03
3
+ size 93249431
data/hardmatch_ccby/fast-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7904497cd61bed1b0fbdb91f0573932b8b8ae216714e4dacfbaadf5bcbeff11a
3
+ size 25315019
data/hardmatch_ccby/large_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b4e21dce3a6fadc0bbeedb497f35e40c60e67629cd8425dd09b3c068e6fc70e2
3
+ size 68444622
data/hardmatch_ccby/standard_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7ea67c70a4f06931a23a44c254e7c8b947b0fb7012e462ae16b900b793d8def8
3
+ size 43544603
data/homography/fast-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e53635bcad1bd29f42913c444e615e6a59d6f9eae826ff835b1b87b5b52278b
3
+ size 18591381
data/homography/large_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e138fc2437c2839034d11d9c8bfd0bffc3f3d1b61682658c1199d584257a9de
3
+ size 94001811
data/homography/standard_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4615556b77eea5016f50de23d2b5aaedc7533749ae5de087ba6af885644a2c23
3
+ size 49055721
data/pose/fast-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c76a07101d1191fbab0731f54fe822b9f1c0fb6385216fb4347f435fec169b3
3
+ size 43556919
data/pose/large_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:daac793c5d5175b9fe2b1b452fe814e91fb288b3c7f3dcdc2fd71146ab83176f
3
+ size 151268810
data/pose/large_ext-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e159ae046de3003ba8fc47e234f2a901bd9c5a2bc1c06f4f8e72389c6fe837da
3
+ size 147796031
data/pose/standard_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8d9e2d4da6114a1beea3be6cd3f68e4c8e8e58c80119c0e4c8d885ad50f3f68a
3
+ size 138775422
data/stereo/fast-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:527c77fe3a88f547503d3b2980b94404ffd26b7bf4e809d2b2e0c0c47d3cc421
3
+ size 17660026
data/stereo/large_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:eebb29cc747e993d669667b09e74b747f1aef78867142dc0ba65b6eca8e6fc52
3
+ size 123214196
data/stereo/standard_ext-00000.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:491e4b081a6c222741e21b9fd571c925d0b311c9df41bcc3d7b449d9b01cb3a6
3
+ size 76251647
eval_comm_match_bench.py ADDED
@@ -0,0 +1,362 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Standalone Evaluation Harness for `Yehe/comm-match-bench` (100% CC BY 4.0).
3
+
4
+ SPDX-License-Identifier: Apache-2.0
5
+
6
+ Evaluates ANY local feature extractor/matcher across ALL 6 benchmark tasks directly
7
+ from Hugging Face (`datasets.load_dataset("Yehe/comm-match-bench", tier)`):
8
+ 1. 3D Relative Camera Pose Estimation (`pose` split: 5 real CC BY 4.0 domains, AUC@5/10/20 deg)
9
+ 2. Planar Homography Stress (`homography` split: rot/illum/geom, AUC@3/5/10 px)
10
+ 3. Non-Rigid Dense Optical Flow (`flow` split: Spring 6-frame chained, MMA@3/5 px + Inliers)
11
+ 4. Dense Rectified Stereo Correspondence (`stereo` split: Spring L<->R, MMA@2/5 px + Inliers)
12
+ 5. Detector Repeatability & Subpixel Loc (`homography` split raw keypoints: Rep@1/3 px + MedLocPx)
13
+ 6. 1-vs-N Global Standalone Retrieval (`pose` split gallery: Recall@1, Recall@5, MRR)
14
+
15
+ Usage:
16
+ pip install datasets opencv-contrib-python numpy scipy
17
+ python eval_comm_match_bench.py --tier fast --matcher rootsift_lowct
18
+ python eval_comm_match_bench.py --tier standard --matcher orb_r085
19
+ python eval_comm_match_bench.py --tier large --matcher sift_lowct --out results.json
20
+ """
21
+
22
+ from __future__ import annotations
23
+
24
+ import argparse
25
+ import json
26
+ import math
27
+ import time
28
+ from collections import defaultdict
29
+ from pathlib import Path
30
+
31
+ import cv2
32
+ import numpy as np
33
+ from datasets import load_dataset
34
+
35
+
36
+ # ---------------------------------------------------------------------------
37
+ # Decoding Helpers for Lossless 16-bit PNG Flow & Stereo Ground Truth
38
+ # ---------------------------------------------------------------------------
39
+
40
+ def decode_flow_png16(png_bytes: bytes) -> tuple[np.ndarray, np.ndarray, np.ndarray]:
41
+ """Decode lossless 16-bit PNG -> (map_x float32, map_y float32, valid bool)."""
42
+ buf = np.frombuffer(png_bytes, dtype=np.uint8)
43
+ arr = cv2.imdecode(buf, cv2.IMREAD_UNCHANGED) # (H, W, 3) uint16 BGR
44
+ valid = arr[..., 0] > 0
45
+ map_y = arr[..., 1].astype(np.float32) / 32.0
46
+ map_x = arr[..., 2].astype(np.float32) / 32.0
47
+ return map_x, map_y, valid
48
+
49
+
50
+ def decode_disp_png16(png_bytes: bytes) -> tuple[np.ndarray, np.ndarray]:
51
+ """Decode lossless 16-bit PNG -> (disparity float32, valid bool)."""
52
+ buf = np.frombuffer(png_bytes, dtype=np.uint8)
53
+ arr = cv2.imdecode(buf, cv2.IMREAD_UNCHANGED) # (H, W, 3) uint16 BGR
54
+ valid = arr[..., 0] > 0
55
+ disp = arr[..., 2].astype(np.float32) / 64.0
56
+ return disp, valid
57
+
58
+
59
+ # ---------------------------------------------------------------------------
60
+ # Standard Geometric Metrics (Pose AUC, Homography AUC, Repeatability, MMA)
61
+ # ---------------------------------------------------------------------------
62
+
63
+ def error_auc(errors: np.ndarray, thresholds: list[float]) -> list[float]:
64
+ if len(errors) == 0:
65
+ return [0.0 for _ in thresholds]
66
+ errs = np.sort(np.asarray(errors, dtype=np.float64))
67
+ recall = (np.arange(len(errs), dtype=np.float64) + 1.0) / float(len(errs))
68
+ errs = np.concatenate([[0.0], errs])
69
+ recall = np.concatenate([[0.0], recall])
70
+ aucs = []
71
+ for thr in thresholds:
72
+ last_idx = int(np.searchsorted(errs, thr))
73
+ r_x = np.concatenate([errs[:last_idx], [thr]])
74
+ r_y = np.concatenate([recall[:last_idx], [recall[last_idx - 1]]])
75
+ aucs.append(float(np.trapezoid(r_y, r_x) / thr) if hasattr(np, "trapezoid") else float(np.trapz(r_y, r_x) / thr))
76
+ return aucs
77
+
78
+
79
+ def relative_pose_error(R_est: np.ndarray, t_est: np.ndarray, R_gt: np.ndarray, t_gt: np.ndarray) -> float:
80
+ tr = np.clip((np.trace(R_est.T @ R_gt) - 1.0) * 0.5, -1.0, 1.0)
81
+ e_R = math.degrees(math.acos(float(tr)))
82
+ n_est = np.linalg.norm(t_est)
83
+ n_gt = np.linalg.norm(t_gt)
84
+ if n_est < 1e-8 or n_gt < 1e-8:
85
+ return 180.0
86
+ cos_t = np.clip(float(np.dot(t_est.ravel(), t_gt.ravel()) / (n_est * n_gt)), -1.0, 1.0)
87
+ e_t = math.degrees(math.acos(cos_t))
88
+ e_t = min(e_t, 180.0 - e_t)
89
+ return max(e_R, e_t)
90
+
91
+
92
+ def eval_pose_pair(mk0: np.ndarray, mk1: np.ndarray, K0: np.ndarray, K1: np.ndarray, R_gt: np.ndarray, t_gt: np.ndarray, ransac_runs: int = 2) -> list[float]:
93
+ errs = []
94
+ if len(mk0) < 5:
95
+ return [180.0] * ransac_runs
96
+ f_avg = 0.5 * (np.mean(np.abs(np.diag(K0)[:2])) + np.mean(np.abs(np.diag(K1)[:2])))
97
+ thr_norm = 0.5 / max(f_avg, 1.0)
98
+ p0n = cv2.undistortPoints(mk0.reshape(-1, 1, 2).astype(np.float64), K0, None).reshape(-1, 2)
99
+ p1n = cv2.undistortPoints(mk1.reshape(-1, 1, 2).astype(np.float64), K1, None).reshape(-1, 2)
100
+ for r in range(ransac_runs):
101
+ perm = np.random.default_rng(100 + r).permutation(len(mk0))
102
+ E, mask = cv2.findEssentialMat(p0n[perm], p1n[perm], np.eye(3), cv2.USAC_MAGSAC, 0.99999, thr_norm)
103
+ if E is None or mask is None or E.shape != (3, 3):
104
+ errs.append(180.0)
105
+ continue
106
+ _, R_est, t_est, _ = cv2.recoverPose(E, p0n[perm], p1n[perm], np.eye(3), mask=mask)
107
+ errs.append(relative_pose_error(R_est, t_est, R_gt, t_gt))
108
+ return errs
109
+
110
+
111
+ def eval_homography_pair(mk0: np.ndarray, mk1: np.ndarray, H_gt: np.ndarray, w0: int, h0: int, w1: int, h1: int) -> float:
112
+ if len(mk0) < 4:
113
+ return float(max(w0, h0))
114
+ thr = 3.0 * min(w1, h1) / 480.0
115
+ H_est, _ = cv2.findHomography(mk0.astype(np.float64), mk1.astype(np.float64), cv2.USAC_MAGSAC, thr, maxIters=5000, confidence=0.9999)
116
+ if H_est is None:
117
+ return float(max(w0, h0))
118
+ corners = np.array([[0, 0], [w0 - 1, 0], [w0 - 1, h0 - 1], [0, h0 - 1]], dtype=np.float64)
119
+ ch = np.concatenate([corners, np.ones((4, 1))], axis=1)
120
+ c_gt = (H_gt @ ch.T).T; c_gt = c_gt[:, :2] / c_gt[:, 2:3]
121
+ c_es = (H_est @ ch.T).T
122
+ if np.any(np.abs(c_es[:, 2]) < 1e-9):
123
+ return float(max(w0, h0))
124
+ c_es = c_es[:, :2] / c_es[:, 2:3]
125
+ return float(np.mean(np.linalg.norm(c_es - c_gt, axis=1)))
126
+
127
+
128
+ def eval_repeatability(kp0: np.ndarray, kp1: np.ndarray, H_gt: np.ndarray, w0: int, h0: int, w1: int, h1: int):
129
+ if len(kp0) < 5 or len(kp1) < 5:
130
+ return 0.0, 0.0, 3.0
131
+ p0h = np.concatenate([kp0.astype(np.float64), np.ones((len(kp0), 1))], axis=1)
132
+ q0 = (H_gt @ p0h.T).T; q0 = q0[:, :2] / np.where(np.abs(q0[:, 2:3]) > 1e-9, q0[:, 2:3], 1e-9)
133
+ q0 = q0[(q0[:, 0] >= 0) & (q0[:, 0] < w1) & (q0[:, 1] >= 0) & (q0[:, 1] < h1)]
134
+ p1h = np.concatenate([kp1.astype(np.float64), np.ones((len(kp1), 1))], axis=1)
135
+ q1b = (np.linalg.inv(H_gt) @ p1h.T).T; q1b = q1b[:, :2] / np.where(np.abs(q1b[:, 2:3]) > 1e-9, q1b[:, 2:3], 1e-9)
136
+ k1v = kp1[(q1b[:, 0] >= 0) & (q1b[:, 0] < w0) & (q1b[:, 1] >= 0) & (q1b[:, 1] < h0)].astype(np.float64)
137
+ denom = min(len(q0), len(k1v))
138
+ if denom < 5:
139
+ return 0.0, 0.0, 3.0
140
+ d2 = (q0[:, None, 0] - k1v[None, :, 0]) ** 2 + (q0[:, None, 1] - k1v[None, :, 1]) ** 2
141
+ nn01, nn10 = d2.argmin(axis=1), d2.argmin(axis=0)
142
+ idx0 = np.arange(len(q0))
143
+ m = nn10[nn01] == idx0
144
+ ds = np.sqrt(d2[idx0[m], nn01[m]])
145
+ u3 = ds[ds < 3.0]
146
+ return float((ds < 1.0).sum() / denom), float((ds < 3.0).sum() / denom), float(np.median(u3) if len(u3) else 3.0)
147
+
148
+
149
+ # ---------------------------------------------------------------------------
150
+ # Built-In Reference OpenCV Extractors (SIFT, RootSIFT, ORB, AKAZE, BEBLID)
151
+ # ---------------------------------------------------------------------------
152
+
153
+ class ReferenceFeature:
154
+ def __init__(self, name: str, max_kpts: int = 2048):
155
+ self.name = name
156
+ self.max_kpts = max_kpts
157
+ self.metric = "hamming" if name.startswith(("orb", "akaze", "beblid")) else "l2"
158
+ self.ratio = 0.85 if self.metric == "hamming" else 0.80
159
+ if name in ("sift", "rootsift"):
160
+ self._det = cv2.SIFT_create(nfeatures=max_kpts)
161
+ elif name in ("sift_lowct", "rootsift_lowct"):
162
+ self._det = cv2.SIFT_create(nfeatures=max_kpts, contrastThreshold=0.01)
163
+ elif name == "orb_r085":
164
+ self._det = cv2.ORB_create(nfeatures=max_kpts)
165
+ elif name == "akaze_r085":
166
+ self._det = cv2.AKAZE_create(threshold=5e-4)
167
+ elif name == "beblid256_orb_r085":
168
+ self._det = cv2.ORB_create(nfeatures=max_kpts)
169
+ self._desc = cv2.xfeatures2d.BEBLID_create(0.75, cv2.xfeatures2d.BEBLID_SIZE_256_BITS)
170
+ else:
171
+ raise ValueError(f"Unknown built-in matcher: {name}")
172
+
173
+ def extract(self, rgb: np.ndarray):
174
+ g = cv2.cvtColor(rgb, cv2.COLOR_RGB2GRAY)
175
+ if self.name == "beblid256_orb_r085":
176
+ kp = self._det.detect(g, None)
177
+ kp, d = self._desc.compute(g, kp)
178
+ else:
179
+ kp, d = self._det.detectAndCompute(g, None)
180
+ if d is None or len(kp) == 0:
181
+ return np.empty((0, 2), np.float32), None
182
+ if len(kp) > self.max_kpts:
183
+ ord_i = np.argsort([-k.response for k in kp])[: self.max_kpts]
184
+ kp = [kp[i] for i in ord_i]; d = d[ord_i]
185
+ pts = np.array([k.pt for k in kp], dtype=np.float32)
186
+ if self.name.startswith("rootsift"):
187
+ d = d.astype(np.float32)
188
+ d /= (d.sum(axis=1, keepdims=True) + 1e-7)
189
+ d = np.sqrt(np.maximum(d, 0.0))
190
+ d /= (np.linalg.norm(d, axis=1, keepdims=True) + 1e-7)
191
+ elif self.metric == "l2":
192
+ d = d.astype(np.float32)
193
+ return pts, d
194
+
195
+ def match(self, kp0, d0, kp1, d1):
196
+ if d0 is None or d1 is None or len(d0) < 2 or len(d1) < 2:
197
+ e = np.empty((0, 2), np.float32); return e, e
198
+ norm = cv2.NORM_HAMMING if self.metric == "hamming" else cv2.NORM_L2
199
+ bf = cv2.BFMatcher(norm, crossCheck=False)
200
+ m01 = bf.knnMatch(d0, d1, k=2)
201
+ m10 = bf.knnMatch(d1, d0, k=2)
202
+ b10 = {i: m[0].trainIdx for i, m in enumerate(m10) if len(m) >= 2 and m[0].distance < self.ratio * m[1].distance}
203
+ pairs = [(i, m[0].trainIdx) for i, m in enumerate(m01) if len(m) >= 2 and m[0].distance < self.ratio * m[1].distance and b10.get(m[0].trainIdx) == i]
204
+ if not pairs:
205
+ e = np.empty((0, 2), np.float32); return e, e
206
+ idx = np.array(pairs, dtype=np.int64)
207
+ return kp0[idx[:, 0]], kp1[idx[:, 1]]
208
+
209
+
210
+ def eval_global_retrieval(q_descs: list, g_descs: list, metric: str, max_per_img: int = 256) -> dict:
211
+ """1-vs-N Standalone Visual Retrieval over all pose gallery images (exact FAISS semantics)."""
212
+ n_q = len(q_descs)
213
+ norm = cv2.NORM_HAMMING if metric == "hamming" else cv2.NORM_L2
214
+ g_vecs, g_ids = [], []
215
+ for i, d in enumerate(g_descs):
216
+ if d is not None and len(d) > 0:
217
+ sub = d[:max_per_img]
218
+ g_vecs.append(sub)
219
+ g_ids.append(np.full(len(sub), i, dtype=np.int32))
220
+ if not g_vecs:
221
+ return {"r1": 0.0, "r5": 0.0, "mrr": 0.0}
222
+ G = np.concatenate(g_vecs, axis=0)
223
+ G_id = np.concatenate(g_ids, axis=0)
224
+ bf = cv2.BFMatcher(norm, crossCheck=False)
225
+ r1, r5, rrs = 0, 0, []
226
+ for i, dq in enumerate(q_descs):
227
+ if dq is None or len(dq) == 0:
228
+ rrs.append(0.0); continue
229
+ knn = bf.knnMatch(dq[:max_per_img], G, k=5)
230
+ scores = np.zeros(n_q, dtype=np.float64)
231
+ for ms in knn:
232
+ if len(ms) >= 5 and ms[4].distance > 1e-6:
233
+ w = max(0.0, (ms[4].distance - ms[0].distance) / ms[4].distance)
234
+ scores[G_id[ms[0].trainIdx]] += w
235
+ rank = int((scores > scores[i]).sum()) + 1
236
+ r1 += int(rank == 1); r5 += int(rank <= 5); rrs.append(1.0 / rank)
237
+ return {"r1": r1 / n_q, "r5": r5 / n_q, "mrr": float(np.mean(rrs)), "n_gallery": n_q}
238
+
239
+
240
+ def main():
241
+ ap = argparse.ArgumentParser()
242
+ ap.add_argument("--repo", default="Yehe/comm-match-bench", help="HF dataset repo or local directory")
243
+ ap.add_argument("--tier", default="fast", choices=["fast", "standard", "large"])
244
+ ap.add_argument("--matcher", default="rootsift_lowct", choices=["sift", "rootsift", "sift_lowct", "rootsift_lowct", "orb_r085", "akaze_r085", "beblid256_orb_r085"])
245
+ ap.add_argument("--ransac-runs", type=int, default=2)
246
+ ap.add_argument("--out", type=str, default=None)
247
+ args = ap.parse_args()
248
+
249
+ t0 = time.perf_counter()
250
+ ds = load_dataset(args.repo, args.tier)
251
+ feat = ReferenceFeature(args.matcher)
252
+ res = {"repo": args.repo, "tier": args.tier, "matcher": args.matcher}
253
+
254
+ # Task 1: 3D Relative Pose + Task 6: 1-vs-N Standalone Retrieval
255
+ pose_errs_by_dom = defaultdict(list)
256
+ q_descs, g_descs = [], []
257
+ for row in ds["pose"]:
258
+ im0, im1 = np.asarray(row["image_a"]), np.asarray(row["image_b"])
259
+ kp0, d0 = feat.extract(im0); kp1, d1 = feat.extract(im1)
260
+ q_descs.append(d0); g_descs.append(d1)
261
+ mk0, mk1 = feat.match(kp0, d0, kp1, d1)
262
+ K0 = np.asarray(row["K0"]).reshape(3, 3); K1 = np.asarray(row["K1"]).reshape(3, 3)
263
+ R = np.asarray(row["R_0to1"]).reshape(3, 3); t = np.asarray(row["t_0to1"]).reshape(3)
264
+ pose_errs_by_dom[row["domain"]].extend(eval_pose_pair(mk0, mk1, K0, K1, R, t, args.ransac_runs))
265
+ res["pose"] = {dom: dict(zip(["auc_5", "auc_10", "auc_20"], error_auc(np.array(es), [5.0, 10.0, 20.0]))) for dom, es in sorted(pose_errs_by_dom.items())}
266
+ res["pose_mean_auc5"] = float(np.mean([v["auc_5"] for v in res["pose"].values()]))
267
+ res["retrieval"] = eval_global_retrieval(q_descs, g_descs, feat.metric)
268
+
269
+ # Task 2: Homography Stress + Task 5: Detector Repeatability
270
+ h_errs_by_dom = defaultdict(list)
271
+ rep1s, rep3s, locs = [], [], []
272
+ for row in ds["homography"]:
273
+ im0, im1 = np.asarray(row["image_a"]), np.asarray(row["image_b"])
274
+ kp0, d0 = feat.extract(im0); kp1, d1 = feat.extract(im1)
275
+ mk0, mk1 = feat.match(kp0, d0, kp1, d1)
276
+ H = np.asarray(row["H_0to1"]).reshape(3, 3)
277
+ h_errs_by_dom[row["domain"]].append(eval_homography_pair(mk0, mk1, H, row["width_a"], row["height_a"], row["width_b"], row["height_b"]))
278
+ r1, r3, le = eval_repeatability(kp0, kp1, H, row["width_a"], row["height_a"], row["width_b"], row["height_b"])
279
+ rep1s.append(r1); rep3s.append(r3); locs.append(le)
280
+ res["homography"] = {dom: dict(zip(["auc_3", "auc_5", "auc_10"], error_auc(np.array(es), [3.0, 5.0, 10.0]))) for dom, es in sorted(h_errs_by_dom.items())}
281
+ res["homography_mean_auc5"] = float(np.mean([v["auc_5"] for v in res["homography"].values()]))
282
+ res["detector"] = {"rep_1px": float(np.mean(rep1s)), "rep_3px": float(np.mean(rep3s)), "med_loc_px": float(np.median(locs))}
283
+
284
+ # Task 3: Non-Rigid Dense Optical Flow (Spring)
285
+ m3s, m5s, ins = [], [], []
286
+ for row in ds["flow"]:
287
+ im0, im1 = np.asarray(row["image_a"]), np.asarray(row["image_b"])
288
+ kp0, d0 = feat.extract(im0); kp1, d1 = feat.extract(im1)
289
+ mk0, mk1 = feat.match(kp0, d0, kp1, d1)
290
+ mx, my, valid = decode_flow_png16(row["flow_gt_png"])
291
+ if len(mk0) > 0:
292
+ ix = np.clip(np.round(mk0[:, 0]).astype(int), 0, row["width"] - 1)
293
+ iy = np.clip(np.round(mk0[:, 1]).astype(int), 0, row["height"] - 1)
294
+ v = valid[iy, ix]
295
+ if np.any(v):
296
+ err = np.hypot(mk1[v, 0] - mx[iy[v], ix[v]], mk1[v, 1] - my[iy[v], ix[v]])
297
+ m3s.append(float((err < 3.0).mean())); m5s.append(float((err < 5.0).mean())); ins.append(int((err < 3.0).sum()))
298
+ else:
299
+ m3s.append(0.0); m5s.append(0.0); ins.append(0)
300
+ else:
301
+ m3s.append(0.0); m5s.append(0.0); ins.append(0)
302
+ res["flow"] = {"mma_3": float(np.mean(m3s)), "mma_5": float(np.mean(m5s)), "mean_inliers_3px": float(np.mean(ins))}
303
+
304
+ # Task 4: Dense Rectified Stereo (Spring)
305
+ sm2s, sm5s, sins = [], [], []
306
+ for row in ds["stereo"]:
307
+ im0, im1 = np.asarray(row["image_a"]), np.asarray(row["image_b"])
308
+ kp0, d0 = feat.extract(im0); kp1, d1 = feat.extract(im1)
309
+ mk0, mk1 = feat.match(kp0, d0, kp1, d1)
310
+ disp, valid = decode_disp_png16(row["disp_gt_png"])
311
+ if len(mk0) > 0:
312
+ ix = np.clip(np.round(mk0[:, 0]).astype(int), 0, row["width"] - 1)
313
+ iy = np.clip(np.round(mk0[:, 1]).astype(int), 0, row["height"] - 1)
314
+ v = valid[iy, ix]
315
+ if np.any(v):
316
+ err = np.hypot(mk1[v, 0] - (mk0[v, 0] - disp[iy[v], ix[v]]), mk1[v, 1] - mk0[v, 1])
317
+ sm2s.append(float((err < 2.0).mean())); sm5s.append(float((err < 5.0).mean())); sins.append(int((err < 2.0).sum()))
318
+ else:
319
+ sm2s.append(0.0); sm5s.append(0.0); sins.append(0)
320
+ else:
321
+ sm2s.append(0.0); sm5s.append(0.0); sins.append(0)
322
+ res["stereo"] = {"mma_2": float(np.mean(sm2s)), "mma_5": float(np.mean(sm5s)), "mean_inliers_2px": float(np.mean(sins))}
323
+
324
+ # Task 7: HardMatch Strictly Non-Copyleft Subset (Uncalibrated F-matrix mAA@10px, WxBS/HardMatch protocol)
325
+ if "hardmatch_ccby" in ds:
326
+ ths = np.arange(1, 11, dtype=np.float64)
327
+ hm_scores = []
328
+ for row in ds["hardmatch_ccby"]:
329
+ im0, im1 = np.asarray(row["image_a"]), np.asarray(row["image_b"])
330
+ kp0, d0 = feat.extract(im0); kp1, d1 = feat.extract(im1)
331
+ mk0, mk1 = feat.match(kp0, d0, kp1, d1)
332
+ gt = np.asarray(row["gt_corrs"], dtype=np.float64).reshape(-1, 4)
333
+ if len(mk0) >= 8:
334
+ Fm, _ = cv2.findFundamentalMat(mk0.astype(np.float64), mk1.astype(np.float64), cv2.USAC_MAGSAC, 1.5, 0.9999, 5000)
335
+ else:
336
+ Fm = None
337
+ if Fm is None or Fm.shape != (3, 3):
338
+ hm_scores.append(0.0)
339
+ continue
340
+ p0h = np.concatenate([gt[:, :2], np.ones((len(gt), 1))], axis=1)
341
+ p1h = np.concatenate([gt[:, 2:], np.ones((len(gt), 1))], axis=1)
342
+ l2 = p0h @ Fm.T
343
+ l1 = p1h @ Fm
344
+ num = np.sum(p1h * l2, axis=1) ** 2
345
+ den = 1.0 / np.maximum(l2[:, 0] ** 2 + l2[:, 1] ** 2, 1e-12) + 1.0 / np.maximum(l1[:, 0] ** 2 + l1[:, 1] ** 2, 1e-12)
346
+ sed = np.sqrt(num * den)
347
+ hm_scores.append(float(np.mean([(sed <= th).mean() for th in ths])))
348
+ res["hardmatch_ccby"] = {"maa_10px": float(np.mean(hm_scores)), "n_pairs": len(hm_scores)}
349
+
350
+ res["suite6_mean"] = float(np.mean([
351
+ res["pose_mean_auc5"], res["homography_mean_auc5"],
352
+ res["flow"]["mma_3"], res["stereo"]["mma_2"],
353
+ res["detector"]["rep_3px"], res["retrieval"]["r1"],
354
+ ]))
355
+ res["wall_s"] = time.perf_counter() - t0
356
+ print(json.dumps(res, indent=2))
357
+ if args.out:
358
+ Path(args.out).write_text(json.dumps(res, indent=2))
359
+
360
+
361
+ if __name__ == "__main__":
362
+ main()