#!/bin/sh
# Nemotron OCR v2 (Core ML port, multilingual model) on every page-*.jpg in this folder. Text goes to book.txt.
# Needs ./apple-ocr-runner (built from SwiftNemotronOCR) and model/coreml from its --download step. jq ships with macOS 15+.
set --
for p in page-*.jpg; do set -- "$@" --image "$p"; done
./apple-ocr-runner --runtime coreml --device ANE --model-dir model/coreml \
  --variant multi --level word "$@" 2> /dev/null | jq -r '.images[].text' > book.txt
