MCPcopy Create free account
hub / github.com/Ropedia/SpatialBench / build_overall

Function build_overall

benchmark/evaluation/report.py:175–215  ·  view source on GitHub ↗

Extract a condensed overall metric summary from the full report. Keeps only the mean values of the most important aggregated metrics for fast model comparison. per_dataset and the top level share the same metric-extraction logic to guarantee complete metrics for every dataset. Retu

(report)

Source from the content-addressed store, hash-verified

173
174
175def build_overall(report):
176 """Extract a condensed overall metric summary from the full report.
177
178 Keeps only the mean values of the most important aggregated metrics for fast model comparison.
179 per_dataset and the top level share the same metric-extraction logic to guarantee
180 complete metrics for every dataset.
181
182 Returns:
183 dict: condensed report
184 """
185 meta = report["meta"]
186 agg = report.get("aggregate", {})
187
188 overall = {
189 "model": meta["model"],
190 "checkpoint": meta["checkpoint"],
191 "query": meta["query"],
192 "num_scenes": meta["num_scenes"],
193 "resolution": meta["resolution"],
194 "timestamp": meta["timestamp"],
195 "model_params": meta.get("model_params", {}),
196 }
197
198 # Top-level metrics: full set of means for depth/tgm/camera/trajectory/pointcloud_*
199 overall.update(_summary_from_agg(agg))
200
201 # Efficiency
202 eff = report.get("efficiency", {})
203 if eff:
204 overall["mean_inference_seconds"] = round(eff.get("mean_inference_seconds", 0), 3)
205
206 # Per-dataset breakdown: same structure as top level, each dataset has the full group/key means
207 per_ds = report.get("per_dataset_breakdown", {})
208 if per_ds:
209 overall["per_dataset"] = {}
210 for ds, bd in per_ds.items():
211 ds_summary = {"num_scenes": bd.get("num_scenes", 0)}
212 ds_summary.update(_summary_from_agg(bd))
213 overall["per_dataset"][ds] = ds_summary
214
215 return overall
216
217
218def write_json_report(report, output_path):

Callers 1

write_overallFunction · 0.85

Calls 3

_summary_from_aggFunction · 0.85
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected