Spaces:
Runtime error
Runtime error
| """Contract smoke test: make the example video, run the fast engine, save outputs.""" | |
| from __future__ import annotations | |
| import json | |
| import sys | |
| import numpy as np | |
| from PIL import Image | |
| from core.io import APP_TMP_DIR | |
| from core.processing import simulate_full | |
| def main() -> int: | |
| tif = APP_TMP_DIR / "example.tif" | |
| if not tif.exists(): | |
| import scripts.make_example as me | |
| me.main() | |
| r = simulate_full(str(tif), engine="fast", fps=15.0, px_per_mm=4.0) | |
| assert r["summary"].ndim == 3 and r["summary"].shape[2] == 3 | |
| assert r["report"]["n_flies"] > 0, "no flies tracked" | |
| Image.fromarray(r["summary"]).save(APP_TMP_DIR / "smoke_summary.png") | |
| print("REPORT:", json.dumps({k: v for k, v in r["report"].items() if k != "per_fly"})) | |
| print("PER_FLY[0]:", json.dumps(r["report"]["per_fly"][0])) | |
| return 0 | |
| if __name__ == "__main__": | |
| sys.exit(main()) | |