--- license: mit pretty_name: "ViewGraphBench" tags: - structure-from-motion - view-graph - pose-graph - rotation-averaging - translation-averaging - pose-graph-optimization - outlier-detection - 3d-vision - synthetic - benchmark task_categories: - graph-ml size_categories: - 10K 0` | | `edge_sigma_trans` | (m,) | float32 | approximate standard deviation of the metric translation per axis [m] | | `edge_n_matches, edge_n_covis` | (m,) | int32 | matches supporting the measured relative pose; co-visible scene points | | `edge_baseline, edge_median_depth` | (m,) | float32 | length of `C_j - C_i`; mean of the two cameras' median point depths [m] | | `edge_view_angle_deg` | (m,) | float32 | angle between the optical axes [deg] | | `edge_overlap_i, edge_overlap_j` | (m,) | float32 | fraction of each camera's points that the other camera also observes | | `edge_err_rot_deg, edge_err_dir_deg, edge_err_trans` | (m,) | float32 | true error of the measurement [deg, deg, m] | | `edge_outlier_type, edge_is_outlier` | (m,) | int8, bool | outlier type (table below); `edge_outlier_type != 0` | | `edge_symmetry_id` | (m,) | int32 | row of the `sym_*` arrays for symmetry-induced outliers, otherwise -1 | | `points_xyz, points_module, points_copy` | (P,3), (P,), (P,) | float32, int32 | scene points [m] (at most 20,000; not stored in `bench_scale`) and their repeated-structure labels (-1 for a unique point) | | `sym_R, sym_t, sym_module, sym_copy_from, sym_copy_to` | (S,3,3), (S,3), (S,) | float64, int32 | the `S` symmetry transforms `X_to = R X_from + t` behind the symmetry-induced outliers (only in graphs with such outliers) | | `obs_cam, obs_point, obs_xy` | (K,), (K,), (K,2) | int32, float32 | image observations of the stored points in normalised coordinates, with the pixel noise of the graph (graphs with stored points and up to 2,000 cameras, at most 300 per camera) | | `edge_outlier_type` | name | measurement | |---:|---|---| | 0 | `none` | the true relative pose with noise (inlier) | | 1 | `random_both` | random rotation and random direction | | 2 | `random_rotation` | random rotation; the direction is the noisy true one | | 3 | `random_translation` | random direction; the rotation is the noisy true one | | 4 | `symmetry` | the relative pose, with noise, to a virtual camera: the true camera moved by a symmetry of the scene, as when a matcher confuses two copies of a repeated structure; consistent around cycles (for the translational symmetries of periodic facades and corridors, the rotation is correct and only the direction is wrong) | | 5 | `gross_error` | not injected: a measurement of the noise model whose error exceeds 10 deg in rotation or 20 deg in direction | Random rotations and directions are uniformly distributed. Because the true error of every edge is stored, other definitions of an outlier can be applied directly; the benchmark, for example, uses a rotation error above 5 deg (a direction error above 10 deg for the direction residual), so the outliers of translational symmetries count only for the direction residual. Among the cases with repeated structure, the urban scene with twin buildings (`manhattan` family) produces few symmetry-induced edges. Conventions: metres; world frame with +z up; OpenCV camera frame (x right, y down, z forward). Relative poses map camera i to camera j, `R_ij = R_j R_i^T` and `t_ij = t_j - R_ij t_i` (`x_j = R_ij x_i + t_ij`), so `E_ij = [t_ij]_x R_ij` satisfies `x_j^T E_ij x_i = 0` and the baseline direction in the world frame is `(C_j - C_i) / |C_j - C_i| = -R_j^T tdir_ij`. Quaternions are stored scalar-last, (qx, qy, qz, qw), the order of SciPy and of the g2o format, with qw >= 0. The `.g2o` files contain `VERTEX_SE3:QUAT` camera-to-world poses `(R_i^T, C_i)`, initialised by chaining the measured relative poses along a maximum spanning tree weighted by the number of matches (not the ground truth), and `EDGE_SE3:QUAT` measurements `Z_ij = T_i^-1 T_j = (R_ij^T, -R_ij^T t_ij)` with the information matrix `diag(I/sigma_trans^2, I/sigma_rot^2)` in the order (x, y, z, qx, qy, qz). `sigma_rot` refers to the rotation vector, as GTSAM and SE-Sync read the block; g2o's own `EdgeSE3` applies it to the vector part of the quaternion, about half the rotation vector, so multiply the rotation block by 4 for the same weighting in g2o. They exist for the graphs of up to 20,000 cameras of every split except `train`; `vgf.write_g2o(graph, path)` writes one for any graph. ![Overview of one graph](https://huggingface.co/datasets/ezharjan/ViewGraphBench/resolve/main/figures/graphs/bench_topology/g0000_orbit_object_n300_r0.png) *One graph in detail: top and 3-D view, adjacency pattern and the measurement errors of each edge class.* ![Symmetry-induced outliers](https://huggingface.co/datasets/ezharjan/ViewGraphBench/resolve/main/figures/symmetry.png) *Repeated structure (`bench_symmetry`): the orange edges are relative poses to a camera moved by a symmetry of the scene. They agree with each other around cycles.* ## Files ``` README.md, LICENSE index.csv one row per graph: split, family, scene, size, settings, files, SHA-256 dataset_info.json counts per split and the complete configuration manifest_sha256.txt SHA-256 of every .g2o and .npz file splits//.npz a graph (splits with up to 3,000 graphs) splits//.g2o the graph as an SE(3) pose graph, without the ground truth (see above) splits//_split.json design record: specification of the split, seed and parameters of every graph splits/train/-/ graphs a to b of train, 1,000 per folder (00000-00999, 01000-01999, ...) stats/ graphs.csv (one row per graph), splits.csv, summary.json, summary.md benchmarks/ results.csv (one row per graph and method), leaderboard.csv/.md, sweeps.csv, run.json figures/ the figures of this page, galleries of every split, overviews of single graphs ``` Graph ids have the form `g___n[_]_r`, for example `g0012_orbit_object_n300_conf0.5_r0`, where the factor is a short code (`px` pixel noise, `out` outlier ratio, `om` outlier mode, `conf` confusability, `k` retrieval depth, `df` degrees of freedom, `mm` minimum matches, `sc` scale noise); sweeps over the number of cameras add no suffix. An id is unique within its split but can occur in several splits, so tables are joined on the pair (`split`, `graph_id`). The graphs of `train` come without `.g2o` files to keep the download small; `vgf.write_g2o` creates them from the `.npz` files. ## Loading the data With the toolkit, after downloading the benchmark splits: ```python import viewgraphforge as vgf index = vgf.read_index("ViewGraphBench") # pandas DataFrame, one row per graph rows = index[(index.split == "bench_outliers") & (index.outlier_ratio_target == 0.3)] graphs = [vgf.load_graph(f"ViewGraphBench/{p}") for p in rows.npz_path] g = graphs[0] R_true, C_true = g.R_wc, g.centers # ground truth: (n,3,3) rotations, (n,3) centres R_ij, tdir_ij = g.R_meas, g.tdir_meas # measurements (m,3,3), (m,3) of the edges g.edges (m,2) ``` With numpy only: ```python import json import numpy as np d = np.load("ViewGraphBench/splits/bench_topology/g0000_orbit_object_n300_r0.npz") meta = json.loads(str(d["meta_json"])) # parameters, seed, statistics i, j, q = d["edge_i"], d["edge_j"], d["edge_q_meas"] ``` The `.g2o` files can be read by g2o and by GTSAM (`readG2o`) as they are. Their first line is a comment, which the reader of SE-Sync does not accept; remove it for SE-Sync. ## How a graph is generated Every graph is generated with a random generator seeded from its own seed: 1. Scene: a procedural point cloud with surface normals (object, facade, corridor, urban block, room, terrain or plaza). The corridor, urban, terrain and facade scenes grow with the number of cameras. Scenes with repeated structure contain identical copies of a module: the sectors of a symmetric object, facade columns, corridor segments, twin buildings or the faces of a monument. 2. Cameras: exactly `n` pinhole cameras (1600 x 1200 px) of one family: `orbit` (a ring around an object), `dome` (several rings on a hemisphere), `corridor` (forward motion along a street), `lawnmower` (an aerial survey), `crowd` (unordered photos of a landmark with varying focal lengths), `walk` (hand-held motion in a room) or `manhattan` (a vehicle on a street grid, with loop closures). 3. Visibility: a point is observed when it lies within the depth range, projects into the image, faces the camera (incidence angle below 80 deg), passes a z-buffer occlusion test and is detected (probability 0.8 by default); at most 3,000 points per image are kept. 4. Edges: in graphs of up to 400 cameras every camera pair is a candidate; larger graphs take the nearest neighbours in camera position and viewing direction, the three previous and next cameras in acquisition order and, for repeated structure, random pairs of cameras that see copies of the same module. Match counts are binomial in the number of co-visible points, with a probability that falls with the angle between the views and the scale change; repeated structure adds competing hypotheses, and the reported relative pose is drawn among those with at least `min_matches` matches, with a preference for the one with the most support. Each camera keeps the `retrieval_k` candidates with the most co-visible points (and up to `cand_sym_k` that look alike through repeated structure), and a candidate becomes an edge when its reported pose has at least `min_matches` matches. The largest connected component is kept. 5. Measurements: the reported relative pose plus noise, either from a closed-form model (`analytic`) or from a simulated two-view estimator (`twoview`). The analytic model is calibrated against the estimator: its errors scale with the pixel noise over the focal length and with 1/sqrt(matches), vary with the baseline-to-depth ratio `rho` as exp(b1 L + b2 L^2) with L = log(rho) and `rho` clipped to [0.08, 10] (below 0.08 the direction error also grows as 1/rho) and carry a log-normal per-edge factor, optionally with Student-t tails (`heavy_tail_df`, analytic model only); a direction that the baseline cannot determine is replaced by a random one. The estimator runs the normalised 8-point algorithm on the noisy correspondences, refines its solution and, separately, the reported pose (standing in for a minimal solver inside RANSAC) by Levenberg-Marquardt minimisation of the Sampson error, keeps the solution with the lower error and reports covariances from the Fisher information; an edge on which it fails keeps the analytic measurement. 6. Outliers: a fraction of the edges, chosen with probability inversely proportional to their number of matches, receives random rotations and/or directions; symmetry-induced outliers come from step 4. The metric translation for the SE(3) variant is the measured direction times the length of the reported relative translation with log-normal noise, and every error is recorded. ## Baselines `vgf benchmark` runs the baselines on the graphs of up to 3,000 cameras (pose-graph optimisation up to 1,500 cameras). Rotation errors are measured after a robust alignment of the global rotation. Positions are compared after a similarity alignment (translation averaging) or a rigid alignment (pose-graph optimisation) and divided by the diagonal of the bounding box of the true camera centres. Outlier detection is scored against the edges with a rotation error above 5 deg (a direction error above 10 deg for the direction residual). The tables give the mean over the graphs of a split of the per-graph median error or F1 score; graphs without labelled outliers are left out of the F1 means, and graphs on which a method failed are left out of its means. This leaderboard covers 3,329 graphs of the splits `test_wild`, `test_wild_large`, `bench_scale`, `bench_noise`, `bench_outliers`, `bench_outlier_mode`, `bench_symmetry`, `bench_density`, `bench_heavytail`, `bench_matches`, `bench_topology`, `bench_twoview`, `bench_twoview_symmetry` and `bench_pgo`. The complete tables are in `benchmarks/leaderboard.md` and the per-graph results in `benchmarks/results.csv`. Rotation averaging, median rotation error [deg] (best value of each split in bold): | split | `spanning_tree` | `chordal_l2` | `chordal_l2+irls_cauchy` | `l1_irls` | `l1_irls_info` | |---|---:|---:|---:|---:|---:| | `test_wild` | 31.9 | 16.3 | 9.94 | **7.63** | 8.88 | | `test_wild_large` | 64.5 | 23.2 | 11.3 | **8.76** | 12.2 | | `bench_scale` | 37.9 | 3.64 | 0.102 | 0.102 | **0.0541** | | `bench_noise` | 41.2 | 2.44 | 0.216 | 0.216 | **0.106** | | `bench_outliers` | 64.5 | 7.72 | 0.763 | **0.0921** | 6.42 | | `bench_outlier_mode` | 68.6 | 11.4 | 0.106 | **0.105** | 2.26 | | `bench_symmetry` | **0.271** | 20.9 | 22.3 | 5.92 | 5.15 | | `bench_density` | 34 | 5.71 | **0.0932** | 0.0933 | 3.86 | | `bench_heavytail` | 0.396 | 0.116 | 0.0929 | 0.0929 | **0.0297** | | `bench_matches` | 35.5 | 2.83 | **0.0773** | **0.0773** | 1.21 | | `bench_topology` | 32.9 | 2.71 | 0.0783 | 0.0783 | **0.0406** | | `bench_twoview` | 28.8 | 2.86 | 0.0803 | 0.0803 | **0.0375** | | `bench_twoview_symmetry` | 0.304 | 29 | 29.1 | 0.153 | **0.044** | | `bench_pgo` | 25.5 | 2.51 | 0.0796 | 0.0796 | **0.0352** | Translation averaging, median position error [% of the diagonal] (best value of each split in bold): | split | `linear_cross@gt_rot` | `linear_cross@l1_irls` | `lud@gt_rot` | `lud@l1_irls` | |---|---:|---:|---:|---:| | `test_wild` | 16.9 | 16.9 | **6.2** | 6.41 | | `test_wild_large` | 15.5 | 15.5 | **5.65** | 5.93 | | `bench_scale` | 13.5 | 13.4 | **1.24** | 1.32 | | `bench_noise` | 15 | 15 | 1.39 | **1.38** | | `bench_outliers` | 13.8 | 13.8 | **2.32** | 2.37 | | `bench_outlier_mode` | 12 | 12.2 | **2.32** | 2.38 | | `bench_symmetry` | 14.3 | 14.2 | **6.21** | 7.86 | | `bench_density` | 15.2 | 15.1 | **1.41** | **1.41** | | `bench_heavytail` | 0.778 | 0.821 | **0.168** | 0.177 | | `bench_matches` | 14.5 | 14.5 | **1.58** | 1.63 | | `bench_topology` | 14.5 | 14.5 | **1.33** | **1.33** | | `bench_twoview` | 14 | 14.1 | **1.26** | **1.26** | | `bench_twoview_symmetry` | 17.9 | 17.6 | **7.33** | 7.72 | | `bench_pgo` | 13.2 | 13.3 | **0.607** | 0.612 | Pose-graph optimisation, median position error [% of the diagonal] (best value of each split in bold): | split | `chain_init` | `lm_l2` | `lm_huber` | `lm_cauchy` | `lm_cauchy@rotavg_init` | |---|---:|---:|---:|---:|---:| | `test_wild` | 7.62 | 12.7 | 5.51 | 6.23 | **3.76** | | `test_wild_large` | 13.6 | 14.3 | 4.53 | 11.9 | **3.47** | | `bench_scale` | 6.45 | 5.97 | 0.221 | 5.49 | **0.134** | | `bench_noise` | 6.95 | 5.65 | 0.206 | 4.66 | **0.112** | | `bench_outliers` | 12.5 | 11.5 | 0.864 | 11.6 | **0.114** | | `bench_outlier_mode` | 14.4 | 13.2 | 0.59 | 12.7 | **0.113** | | `bench_symmetry` | 0.649 | 15 | 10.5 | **0.107** | 4.23 | | `bench_density` | 7.65 | 6.64 | 0.585 | 6.24 | **0.11** | | `bench_heavytail` | 0.806 | 0.117 | 0.0987 | 0.0904 | **0.0901** | | `bench_matches` | 7.86 | 6.11 | 0.544 | 6.51 | **0.424** | | `bench_topology` | 6.29 | 6.15 | 0.187 | 5.02 | **0.0964** | | `bench_twoview` | 5.74 | 5.86 | 0.191 | 4.45 | **0.104** | | `bench_twoview_symmetry` | 0.704 | 18.4 | 15.3 | **0.124** | 6.68 | | `bench_pgo` | 7.88 | 5.96 | 1.38 | 5.23 | **1.04** | Outlier detection, F1 score (best value of each split in bold): | split | `cycle_consistency` | `rot_residual@l1_irls` | `dir_residual@lud` | |---|---:|---:|---:| | `test_wild` | 0.784 | **0.851** | 0.787 | | `test_wild_large` | 0.775 | **0.849** | 0.768 | | `bench_scale` | 0.997 | **0.999** | 0.902 | | `bench_noise` | 0.950 | **0.991** | 0.905 | | `bench_outliers` | 0.995 | **0.996** | 0.868 | | `bench_outlier_mode` | 0.910 | **0.993** | 0.788 | | `bench_symmetry` | 0.238 | **0.671** | 0.514 | | `bench_density` | 0.978 | **0.997** | 0.883 | | `bench_heavytail` | 0.813 | **0.945** | 0.740 | | `bench_matches` | 0.996 | **0.999** | 0.910 | | `bench_topology` | 0.998 | **0.999** | 0.908 | | `bench_twoview` | 0.982 | **0.996** | 0.907 | | `bench_twoview_symmetry` | 0.332 | **0.891** | 0.518 | | `bench_pgo` | 0.997 | **0.999** | 0.921 | Rotation averaging: `spanning_tree` chains the relative rotations along a maximum spanning tree weighted by the number of matches; `chordal_l2` is the chordal least-squares solution (Martinec and Pajdla 2007), refined by Cauchy-weighted IRLS in `chordal_l2+irls_cauchy`; `l1_irls` is L1 averaging followed by IRLS (Chatterjee and Govindu 2013, 2018), with information weights in `l1_irls_info`. Translation averaging: `linear_cross` (Govindu 2001) and `lud` (Özyeşil and Singer 2015) estimate the camera centres from the ground-truth rotations (`@gt_rot`) or from the `l1_irls` rotations (`@l1_irls`). Pose-graph optimisation: `chain_init` is the spanning-tree chaining of the metric measurements alone; `lm_l2`, `lm_huber` and `lm_cauchy` are Levenberg-Marquardt optimisation with the named loss started from it, and `lm_cauchy@rotavg_init` starts from the `l1_irls` rotations and robustly solved centres (Carlone et al. 2015). Outlier detection: `cycle_consistency` flags an edge when none of its triangles closes within 5 deg (at most 30 sampled triangles; edges without a triangle are kept), a simple form of the loop test of Zach et al. 2010; `rot_residual@l1_irls` and `dir_residual@lud` flag the measurements that disagree with the averaged rotations by more than 5 deg or with the averaged positions by more than 10 deg.

Rotation averaging against the fraction of random outliers Outlier detection against the confusability of repeated structure Rotation averaging against the pixel noise Rotation averaging against the number of cameras (up to 2,500)

*From left to right and top to bottom: rotation averaging against the fraction of random outliers; outlier detection against the confusability of repeated structure; rotation averaging against the pixel noise; rotation averaging against the number of cameras (up to 2,500). Each point is the mean over the graphs of one level (for the F1 score, over its graphs with labelled outliers).* ## Regenerating and extending the dataset These commands regenerate the dataset and the files of this repository: ``` pip install viewgraphforge vgf config full vgf generate --config full --out data_full --workers 16 vgf validate --data data_full --workers 16 vgf stats --data data_full --workers 16 vgf benchmark --data data_full --splits "bench_*" "test_*" --workers 16 vgf visualize --data data_full vgf export --data data_full --out data_hub vgf card --data data_hub ``` `vgf config full` prints the configuration of this dataset, `vgf generate` continues where it stopped when it is run again after an interruption, and the last two commands produce the layout of this repository and this page. The seed of every graph is derived from the global seed, the split and the place of the graph in the design (its index in a `wild` split, its case and repetition in a sweep or grid), so the result depends neither on the number of workers nor on the order of execution. With the same platform and library versions a regenerated graph is identical array by array; only the generation times in its metadata differ, so the file hashes differ between runs. Elsewhere the last bits of floating-point results can differ. That can flip a visibility or matching decision, after which the graph continues with a different random stream and becomes another sample of the same distribution. Regenerated on Linux with numpy 2.5.3 and scipy 1.18.1, 61 benchmark graphs of this copy (made on Windows) kept their edges, match counts and labels, while 3 of 7 training graphs (two with the `twoview` estimator, one with more than 400 cameras) did not; with numpy 2.4.4 and scipy 1.17.1, 26 of the 61 benchmark graphs differed as well. Regenerated copies are therefore compared with `vgf validate` and the statistics, not by file hash. Generating the published copy took about 13 hours with 16 worker processes on a laptop with 16 logical CPUs and 32 GB of RAM. The 100,000-camera graphs of `bench_scale` take from 3 minutes to 2.7 hours each and up to 4.3 GB of memory; `vgf generate` schedules the graphs against a memory budget. A configuration is a YAML file that lists the splits and their factor levels; `vgf config smoke > my.yaml` writes a small one to start from, and `vgf generate --config my.yaml --out my_data` builds a dataset in the same format. ## Validation `vgf validate --data ` checks every graph: array shapes, index ranges and duplicate edges; unit quaternions and directions; the centres, gravity vectors, true relative poses, baselines and errors against the ground-truth poses and the measurements; that `edge_is_outlier` agrees with `edge_outlier_type`; the image observations against the poses and points; the `.g2o` file against the arrays (measurements, information matrices and initial poses); the row of the graph in `index.csv`; and the SHA-256 of its files listed in `manifest_sha256.txt`. Every file listed in the index or the manifest must exist, so run it on complete splits downloaded together with `index.csv` and `manifest_sha256.txt`. ## Limitations * There are no images. Feature detection and matching are statistical models, and appearance enters only through the confusability of repeated structure. * The cameras are ideal pinhole cameras with known intrinsics, without lens distortion, rolling shutter or motion blur. * The scenes are procedural layouts of seven types, not reconstructions of real places. * The analytic noise model is calibrated against the simulated two-view estimator, not against real image pairs; the `twoview` graphs use the estimator itself, which sees only correct correspondences with Gaussian pixel noise (mismatched features and RANSAC are not simulated). * Random outliers are uniform over rotations or directions, and symmetry-induced outliers follow the symmetry exactly; real matchers also produce partly wrong and mixed measurements. ## Citation If you use the dataset, please cite: ```bibtex @misc{viewgraphbench2026, title = {ViewGraphBench: Physically-Grounded Synthetic View Graphs for Global Structure-from-Motion Calibration}, author = {Aiersilan, Aizierjiang}, year = {2026}, note = {Dataset version 1.0.0, generated with ViewGraphForge}, howpublished = {Hugging Face Hub}, url = {https://huggingface.co/datasets/ezharjan/ViewGraphBench} } ``` The references of the baseline methods are listed in the [toolkit README](https://github.com/Ezharjan/ViewGraphForge#15-references). ## License MIT License, Copyright (c) 2026 Aizierjiang Aiersilan. See `LICENSE`.