MCPcopy Create free account
hub / github.com/MAC-VO/MAC-VO / test_macvo_performance

Function test_macvo_performance

Scripts/UnitTest/test_performance_macvo.py:15–34  ·  view source on GitHub ↗
(file_name: str, data: str, expect_ate: float, expect_rte: float, expect_roe: float)

Source from the content-addressed store, hash-verified

13 ("./Scripts/UnitTest/assets/test_config/MACVO/MACVO.yaml", "./Scripts/UnitTest/assets/test_sequence/TartanAir2_abs_P000", 0.002, 0.0025, 0.045), # at 2024 Sept. 22
14])
15def test_macvo_performance(file_name: str, data: str, expect_ate: float, expect_rte: float, expect_roe: float):
16 seq = TartanAirV2_StereoSequence(dict(
17 root=data,
18 compressed=True, gtFlow=False, gtDepth=False, gtPose=True
19 ))
20 cfg, cfg_dict = load_config(Path(file_name))
21 result = Sandbox(Path("./cache/macvo_test_temp"))
22 result.set_autoremove()
23 result.config = cfg_dict | {"Project": "MACVO_Test"}
24
25 system = MACVO[StereoFrame].from_config(cfg)
26 system.receive_frames(seq, result)
27
28 headers, metrics = EvaluateSequences([str(result.folder)], False)
29
30 avg_ATE, avg_RTE, avg_ROE = metrics[0][1], metrics[0][4], metrics[0][7]
31
32 assert avg_ATE <= expect_ate, f"Perofmance did not match expectation! get {avg_ATE=}, but expect {expect_ate}"
33 assert avg_RTE <= expect_rte, f"Perofmance did not match expectation! get {avg_RTE=}, but expect {expect_rte}"
34 assert avg_ROE <= expect_roe, f"Perofmance did not match expectation! get {avg_ROE=}, but expect {expect_roe}"

Callers

nothing calls this directly

Calls 7

set_autoremoveMethod · 0.95
load_configFunction · 0.90
SandboxClass · 0.90
EvaluateSequencesFunction · 0.90
receive_framesMethod · 0.80
from_configMethod · 0.45

Tested by

no test coverage detected