Beispiel #1
0
def test_features_statistics_null(
    scene_synthetic: synthetic_scene.SyntheticInputData,
    null_scene: types.Reconstruction,
) -> None:
    dataset = synthetic_dataset.SyntheticDataSet(
        null_scene,
        scene_synthetic.exifs,
        scene_synthetic.features,
        scene_synthetic.tracks_manager,
    )

    features_statistics = stats.features_statistics(
        dataset, scene_synthetic.tracks_manager, [null_scene]
    )

    assert list(features_statistics.keys()) == [
        "detected_features",
        "reconstructed_features",
    ]
    assert (
        features_statistics["detected_features"]
        == features_statistics["reconstructed_features"]
    )
    assert features_statistics["reconstructed_features"] == {
        "min": -1,
        "max": -1,
        "mean": -1,
        "median": -1,
    }
Beispiel #2
0
def test_features_statistics_normal(
    scene_synthetic: synthetic_scene.SyntheticInputData,
) -> None:
    reference = scene_synthetic.reconstruction
    dataset = synthetic_dataset.SyntheticDataSet(
        reference,
        scene_synthetic.exifs,
        scene_synthetic.features,
        scene_synthetic.tracks_manager,
    )

    features_statistics = stats.features_statistics(
        dataset, scene_synthetic.tracks_manager, [reference]
    )
    assert list(features_statistics.keys()) == [
        "detected_features",
        "reconstructed_features",
    ]
    assert (
        features_statistics["detected_features"]
        == features_statistics["reconstructed_features"]
    )
    assert features_statistics["reconstructed_features"] == {
        "min": 303,
        "max": 1065,
        "mean": 841,
        "median": 884,
    }