File size: 1,363 Bytes
bc88015
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
"""Run the actual ASCENT pilot; accept either a local assembly or pinned Hub revision."""

from __future__ import annotations

import argparse
import json

from cell_tracking.data.wormtrack_verify import BenchmarkClient
from cell_tracking.evaluation.wormtrack_verify import (
    association_metrics,
    corrupt_tracks,
    reference_residual_scores,
    verifier_metrics,
)


def run(client):
    clean = client.load_tracks("ascent-opterra", label_source="human_corrected")
    cloud = client.load_reference_cloud("ascent-opterra")
    corrupt = corrupt_tracks(
        clean, kind="swap_recovery", seed=20261007, start_frame=300, stop_frame=700
    )
    scores = reference_residual_scores(corrupt, cloud)
    metrics = verifier_metrics(scores, corrupt.is_error, threshold=5.0)
    metrics.pop("risk_coverage")
    volume = client.load_volume("ascent-opterra", frame=0)
    print(
        json.dumps(
            {
                "volume_czyx": list(volume.shape),
                "association": association_metrics(clean, corrupt),
                "verifier": metrics,
            },
            indent=2,
        )
    )


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--root")
    parser.add_argument("--revision")
    args = parser.parse_args()
    run(BenchmarkClient(root=args.root, revision=args.revision))