#!/usr/bin/env python3
"""Inspect pen boxes near the run edges (start 2430, end 2567) to decide
the prune range. Prints box coords + conf for frames 2425-2435 and
2555-2567 from the filtered file.
"""
import json
import os

JOB_DIR = "/home/agent/.claude/workspace/project/data/out/c3de403cfd15"
FILT = os.path.join(JOB_DIR, "shipin1_tail_paintmarker_filtered.boxes.json")


def main():
    rows = {r["frame"]: r for r in json.load(open(FILT))}
    for lo, hi in ((2425, 2435), (2555, 2567)):
        print(f"--- frames {lo}-{hi} ---")
        for f in range(lo, hi + 1):
            r = rows.get(f)
            bs = (r or {}).get("boxes") or []
            cs = (r or {}).get("conf") or []
            if bs:
                print(f"f{f}: {[[round(v) for v in b] for b in bs]} conf={[round(c, 2) for c in cs]}")
            else:
                print(f"f{f}: no pen box")


if __name__ == "__main__":
    main()
