trackingBench / examples /pilot.py
AdamGohain's picture
Document WormTrack-Verify alpha scope and pinned source inventory (#1)
bc88015
Raw History Blame Contribute Delete
1.36 kB
"""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))