From 722e2589029ebcc926dbd1ea60b80291a9a1c3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferdinand=20M=C3=BCtsch?= Date: Mon, 7 Oct 2019 21:28:25 +0200 Subject: [PATCH] Add summary row for performance benchmark. --- PythonAPI/util/performance_benchmark.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/PythonAPI/util/performance_benchmark.py b/PythonAPI/util/performance_benchmark.py index d15835e8c..18b9d6453 100755 --- a/PythonAPI/util/performance_benchmark.py +++ b/PythonAPI/util/performance_benchmark.py @@ -247,10 +247,20 @@ def serialize_records(records, system_specs, filename): record['fps_std']) fd.write(s) + s = "| | | | | **{:03.2f}** | **{:03.2f}** |\n".format(*get_total(records)) + fd.write(s) + s = "Table: {}.\n".format(system_specs) fd.write(s) +def get_total(records): + record_vals = [item for sublist in records.values() for item in sublist] + total_mean_fps = sum([r['fps_mean'] for r in record_vals]) / len(record_vals) + total_mean_std = sum([r['fps_std'] for r in record_vals]) / len(record_vals) + return total_mean_fps, total_mean_std + + def get_system_specs(): str_system = "" cpu_info = cpuinfo.get_cpu_info()