feat(#112): photo segmentation pipeline — modular package + tests #114

Merged
Mark merged 1 commit from photo-segmentation/t_218724de into main 2026-08-06 03:32:31 +00:00
Owner

Photo-segmentation pipeline — recovery of #109 dirty-tree work

This PR lands the photo-segmentation pipeline recovered from the 2026-07-29 dirty-tree
incident (#109). Per the triage decision (KEEP — memo on kanban task t_6e79674c), the
implementation was already committed on branch photo-segmentation/t_218724de at
4709f09 and is tracked by review issue #112. This PR is the review/merge vehicle
for that branch, executed by the KEEP executor card t_ea8387b4.

A separate recovery issue was not filed: #112 already serves as the review tracker
for exactly this branch, and filing a duplicate would split the review trail. The
"recovered from dirty tree" framing lives in #109; #112 is the live tracker.

What's in the branch (31 files, +3402)

  • src/segmentation/ — modular package implementing all 4 scope items from
    docs/photo-segmentation-design-state.md:
    1. Segmentation pipeline: Felzenszwalb + spectral saliency + DoG edge snapping +
      weighted palette allocation (mode_router.py — 5-mode table, stages [1]–[8])
    2. Contour-to-PathData mapper with mm scaling and satin/fill hints (mapper.py)
    3. Shared-boundary outline extraction via KD-tree (outline_extract.py)
    4. Gradient structure via LAB-merge (gradient_detect.py)
  • docs/photo-segmentation-design-state.md — the design spec
  • tests/segmentation/ (9 files), tests/e2e/, tests/fixtures/ — 95 tests

Verification (run 2026-07-30 from a clean git archive of 4709f09)

  • pytest tests/segmentation/ tests/e2e/ → 95 passed (71 unit + 24 e2e)
  • ruff check src/segmentation/ tests/segmentation/ tests/e2e/ tests/fixtures/ → clean
  • No new dependencies — Pillow, numpy, scikit-image, scipy, opencv-python already in
    pyproject.toml

Out-of-scope leftovers (removed by the KEEP executor per triage memo)

src/raster/photo_segmentation.py, tests/test_photo_segmentation.py,
hermes-verify-e2e.py — the earlier single-file cv2 prototype + scratch script,
redundant with src/segmentation/. Deleted from the working tree to unblock the
kilo-gsd pre-dispatch gate; byte-for-byte backup kept in the kanban workspace
(workspaces/t_0ba18761/leftover-backup/).

Ref: #112 (review tracker), #109 (root-cause incident), #111 (lint preflight).

## Photo-segmentation pipeline — recovery of #109 dirty-tree work This PR lands the photo-segmentation pipeline recovered from the 2026-07-29 dirty-tree incident (#109). Per the triage decision (KEEP — memo on kanban task t_6e79674c), the implementation was already committed on branch `photo-segmentation/t_218724de` at `4709f09` and is tracked by review issue **#112**. This PR is the review/merge vehicle for that branch, executed by the KEEP executor card t_ea8387b4. A separate recovery issue was **not** filed: #112 already serves as the review tracker for exactly this branch, and filing a duplicate would split the review trail. The "recovered from dirty tree" framing lives in #109; #112 is the live tracker. ### What's in the branch (31 files, +3402) - `src/segmentation/` — modular package implementing all 4 scope items from `docs/photo-segmentation-design-state.md`: 1. Segmentation pipeline: Felzenszwalb + spectral saliency + DoG edge snapping + weighted palette allocation (`mode_router.py` — 5-mode table, stages [1]–[8]) 2. Contour-to-PathData mapper with mm scaling and satin/fill hints (`mapper.py`) 3. Shared-boundary outline extraction via KD-tree (`outline_extract.py`) 4. Gradient structure via LAB-merge (`gradient_detect.py`) - `docs/photo-segmentation-design-state.md` — the design spec - `tests/segmentation/` (9 files), `tests/e2e/`, `tests/fixtures/` — 95 tests ### Verification (run 2026-07-30 from a clean git archive of `4709f09`) - `pytest tests/segmentation/ tests/e2e/` → **95 passed** (71 unit + 24 e2e) - `ruff check src/segmentation/ tests/segmentation/ tests/e2e/ tests/fixtures/` → clean - No new dependencies — Pillow, numpy, scikit-image, scipy, opencv-python already in `pyproject.toml` ### Out-of-scope leftovers (removed by the KEEP executor per triage memo) `src/raster/photo_segmentation.py`, `tests/test_photo_segmentation.py`, `hermes-verify-e2e.py` — the earlier single-file cv2 prototype + scratch script, redundant with `src/segmentation/`. Deleted from the working tree to unblock the kilo-gsd pre-dispatch gate; byte-for-byte backup kept in the kanban workspace (`workspaces/t_0ba18761/leftover-backup/`). Ref: #112 (review tracker), #109 (root-cause incident), #111 (lint preflight).
feat(#112): photo segmentation pipeline — modular package + tests
Some checks failed
CI / Lint (pull_request) Failing after 13s
CI / Type Check (pull_request) Failing after 11s
CI / Test (fast) (pull_request) Failing after 12s
CI / Test (Python 3.10) (pull_request) Failing after 12s
CI / Test (Python 3.12) (pull_request) Failing after 11s
CI / Test (slow) (pull_request) Failing after 35s
CI / Test (Python 3.9) (pull_request) Failing after 12s
CI / Test (Python 3.11) (pull_request) Failing after 2m20s
4709f09e39
Implements all 4 scope items from docs/photo-segmentation-design-state.md:
1. Felzenszwalb + spectral saliency + DoG edge snapping + weighted palette pipeline
2. Contour-to-PathData mapper
3. Shared-boundary outline extraction
4. Gradient fill detection via LAB-merge

Adds src/segmentation/ (11 files), tests/segmentation/ (9 files),
tests/e2e/ + tests/fixtures/ (e2e over synthetic photos, all 5 modes + #101
coastal regression).

Verification: 96 unit+e2e tests pass, ruff clean on feature scope, deps all
pre-declared in pyproject.toml. Tracks work originally landed untracked in
the dirty tree (see #109); this commit restores the review trail.
Mark merged commit e024d2e75d into main 2026-08-06 03:32:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/easystitch!114
No description provided.