def write_to_main(): b.start() tr = b.run(boxes=True, transforms=True, return_row=False) b.start() lo = b.run(images=True, passes="_img", return_row=False) b.start() hi = b.run(images=True, passes="_img", return_row=False, hi_res=True, size=1024) txt = PATH.read_text() txt = txt.replace("$TRANSFORMS_" + machine_key, str(tr)) txt = txt.replace("$IMG_LOW_" + machine_key, str(lo)) txt = txt.replace("$IMG_HIGH_" + machine_key, str(hi)) PATH.write_text(txt)
'w': 0.896455509572624 } }]) return self.get_benchmark(2000) if __name__ == "__main__": parser = ArgumentParser() parser.add_argument('--main', action='store_true') parser.add_argument('--machine', type=str, default='legion_lenovo', choices=['legion_lenovo', 'braintree', 'node11']) args = parser.parse_args() b = FlexBenchmarker() fps = b.run() print(fps) if args.main: machine_key = args.machine.upper() if machine_key == "LEGION_LENOVO": if system() == "Windows": machine_key += "_WINDOWS" else: machine_key += "_UBUNTU" txt = PATH.read_text() txt = txt.replace("$FLEX_" + machine_key, str(int(fps))) PATH.write_text(txt) b.communicate({"$type": "terminate"})
import psutil from argparse import ArgumentParser from benchmark_utils import PATH if __name__ == "__main__": parser = ArgumentParser() parser.add_argument('machine', type=str, default='legion_lenovo') args = parser.parse_args() keys = { "legion_lenovo": "$MACHINE_WINDOWS", "braintree": "$MACHINE_BRAINTREE", "node11": "$MACHINE_NODE11" } txt = PATH.read_text() os_name = platform.system() cpu = str(psutil.cpu_freq()[0] / 1000.0) + " GHz " + str(psutil.cpu_count() + " Cores") memory = str(round(round( psutil.virtual_memory().total / 1000000000))) + " GB" py_version = platform.python_version() # Get the GPU info. if platform.system() == "Windows": import wmi gpus = ", ".join( map(str, [gpu.Name for gpu in wmi.WMI().Win32_VideoController()])) else: from subprocess import check_output
from pathlib import Path from argparse import ArgumentParser from benchmark_utils import PATH parser = ArgumentParser() parser.add_argument("version", type=str, nargs="?", help="Version number") args = parser.parse_args() txt = Path("../../Documentation/benchmark/template.md").read_text() txt = txt.replace("$TDW_VERSION", f"TDW v{args.version}") PATH.write_text(txt)