(config: str)
| 14 | [(str(f),) for f in Path("./Scripts/UnitTest/assets/test_module_config/Depth").glob("*.yaml")] |
| 15 | ) |
| 16 | def test_matching(config: str): |
| 17 | cfg, _ = load_config(Path(config)) |
| 18 | seq = TartanAirV2_StereoSequence(dict( |
| 19 | root="./Scripts/UnitTest/assets/test_sequence/TartanAir2_abs_P000", |
| 20 | compressed=True, |
| 21 | gtFlow=False, gtDepth=True, gtPose=True |
| 22 | )) |
| 23 | |
| 24 | frameA = seq[0] |
| 25 | stereo_depth = IStereoDepth.instantiate(cfg.type, cfg.args) |
| 26 | depth_output = stereo_depth.estimate(frameA.stereo) |
| 27 | |
| 28 | assert depth_output.depth is not None |
| 29 | B, C, H, W = seq[0].stereo.imageL.shape |
| 30 | |
| 31 | # Check flow shape validity |
| 32 | assert depth_output.depth.shape == torch.Size([B, 1, H, W]) |
| 33 | |
| 34 | if depth_output.cov is not None: |
| 35 | assert depth_output.cov.shape == torch.Size([B, 1, H, W]) |
| 36 | |
| 37 | if depth_output.mask is not None: |
| 38 | assert depth_output.mask.shape == torch.Size([B, 1, H, W]) |
| 39 | assert depth_output.mask.dtype == torch.bool |
| 40 | |
| 41 | del stereo_depth |
| 42 | torch.cuda.empty_cache() |
nothing calls this directly
no test coverage detected