6 Commits
Author SHA1 Message Date
adamfandClaude Opus 5.5 e2330c6f77 Add Claude Haiku baseline
Port the display reader from the web server's rowing module as a second
extraction method: send the whole photo to claude-haiku-4-5 and ask for
elapsed time and distance as JSON. The prompt, model and reply parsing
are unchanged; what is new is reading from a file, converting the reply
to WorkoutStats so both methods produce the same rows, and accepting
ANTHROPIC_API_KEY as well as CLAUDE_API_KEY.

Select it with 'rowing-stats --method haiku'. The anthropic SDK is an
optional extra, imported only when the baseline is used, so the OCR
pipeline still installs and runs without it or an API key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:49:13 +01:00
adamfandClaude Opus 5.5 685ee9bf3d Add README
Cover the problem, the approach, how to run it, and its limitations,
including measured extraction rates on the sample photos.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:19 +01:00
adamfandClaude Opus 5.5 3017cac31b Add tests for parsing, image loading, display detection and CLI
Tesseract is stubbed out except in one end-to-end smoke test on a sample
photo, which is skipped when the binary is not installed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:19 +01:00
adamfandClaude Opus 5.5 9bfdc1330f Restructure prototype into the rowing_stats package
Split the script into one module per pipeline stage (image_io, display,
ocr, parsing, pipeline, cli), with type hints throughout, and add
packaging metadata and pinned dependencies.

Failures are now typed exceptions instead of None returns and prints:
unreadable, corrupt or missing images raise ImageLoadError, a photo with
no detectable display raises DisplayNotFoundError, and a missing
Tesseract binary raises TesseractNotInstalledError. The CLI reports a
bad file and carries on, and exits non-zero if any file failed. It also
gains JSON and CSV output.

Behaviour changes:
- OCR runs in sparse-text mode (--psm 11) without a character whitelist.
  The previous single-word mode (--psm 8) parsed no fields from any of
  the sample photos, and the whitelist made Tesseract drop the spaces
  the parser relies on to separate fields.
- A 'Cal/hr' reading is no longer also reported as total calories.
- The '500m' in a '/500m' pace label is no longer reported as distance.
- A pace is no longer reported as elapsed time.
- The distance is no longer also reported as projected distance.
- Debug contour images are actually written (the float boxes were
  rejected by drawContours and the error swallowed).

The unused matplotlib/imshow display helpers are dropped; plotting lives
in the walkthrough notebook, which replaces the scratch one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:19 +01:00
adamfandClaude Opus 5.5 9b1f7e5898 Add single-script OCR prototype
Find the square LCD by contour detection, perspective-warp it, binarise
it and run Tesseract over the result, then pull the stats out of the
text with regular expressions. A scratch notebook plots the stages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:19 +01:00
adamfandClaude Opus 5.5 be9db5ba0d Add sample photos of the PM5 monitor
65 handheld phone photos of a Concept2 PM5 display, taken after rowing
sessions between November 2025 and March 2026. These are the input the
extraction pipeline is developed against.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 11:46:19 +01:00