#!/usr/bin/env bash
set -euo pipefail

python3 -m venv .venv-vision
.venv-vision/bin/python -m pip install -r scripts/benchmarks/vision-requirements.txt

MPLCONFIGDIR=.benchmarks-cache/matplotlib \
  .venv-vision/bin/python scripts/benchmarks/vision-detection.py \
  --data coco-val \
  --models yolo11n.pt yolo11s.pt \
  --imgsz 320 480 640 \
  --runs 200 \
  --warmup 20 \
  --device mps \
  --runtime pytorch \
  --batch 16 \
  --output public/reports/vision-detection-deployment-benchmark-2026/local-mps

MPLCONFIGDIR=.benchmarks-cache/matplotlib \
  .venv-vision/bin/python scripts/benchmarks/vision-detection.py \
  --data coco-val \
  --models yolo11n.pt yolo11s.pt \
  --imgsz 640 \
  --runs 200 \
  --warmup 20 \
  --device mps \
  --runtime coreml \
  --batch 16 \
  --output public/reports/vision-detection-deployment-benchmark-2026/local-coreml

.venv-vision/bin/python scripts/benchmarks/vision-report.py \
  public/reports/vision-detection-deployment-benchmark-2026/local-mps/raw-results.json \
  public/reports/vision-detection-deployment-benchmark-2026/local-coreml/raw-results.json \
  --output public/reports/vision-detection-deployment-benchmark-2026
