Reviewer improvements: independent crop boxes, audio waveform, auto-advance#1
Open
glenWaltron wants to merge 5 commits into
Open
Reviewer improvements: independent crop boxes, audio waveform, auto-advance#1glenWaltron wants to merge 5 commits into
glenWaltron wants to merge 5 commits into
Conversation
The reviewer modelled the image as a single 1:3 box sliced into three equal
stacked squares — great for an upright workbook character, but unusable for
"plain"/panel-not-detected pages where head, torso and legs are separate
drawings scattered around the sheet (you couldn't frame them independently).
Add an opt-in "Independent boxes" mode: three colour-coded crop boxes
(top/middle/bottom) that each move and resize freely, anywhere on the page,
and crop to their own 1024x1024 opaque tile.
- image_ops.py: new retile_boxes() (three independent rects -> three tiles,
same opaque/raw-paper output as slice_and_resize) + optional `boxes` field
on ImageState so the choice persists.
- reviewer/app.py: /api/retile now accepts {boxes:{top,middle,bottom}} as well
as the legacy {box:[...]}; single-box recompute clears `boxes` so state stays
coherent.
- reviewer/static/index.html: a toggle, a 3-box editor (drag/resize each,
topmost-wins hit-testing), a colour legend, and persistence on reload.
The default deterministic + Claude-escalation pipeline is unchanged; this is a
reviewer-side override. export.py needs no change (it copies the tile PNGs).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Follow-up reviewer improvements on top of the independent-boxes feature:
- Default to independent-box mode on every story (seeded from the single
box's equal thirds); the single-box toggle still works.
- Audio splitter now draws the full recording's peak-envelope waveform behind
the timeline so cut points can be placed on the quiet gaps between chapters.
New GET /api/waveform/{id} returns a down-sampled, normalised envelope,
cached to audio/waveform.json (computed with librosa).
- "Save & mark reviewed" auto-advances to the next unreviewed story, and the
reviewer opens straight on the first story still left to review.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Some pages can't be processed and shouldn't sit in the review queue or be
exported. Add an "Archive" state distinct from "reviewed":
- reviewer/app.py: POST /api/archive/{id} sets archived=True (clears reviewed);
saving/reviewing clears archived. /api/ids now returns `archived`.
- reviewer/static/index.html: "🗄 Archive (can't process)" button that
auto-advances; sidebar shows a 🗄 badge; the "next / left to do" queue skips
both reviewed and archived.
- scripts/export.py: archived ids are never exported (even with
--include-unreviewed).
Archived state lives in WORK/<id>/status.json, so it's visible and reversible.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The splitter used 4 shared edges, forcing the three clips to be contiguous, so
silence/chatter BETWEEN sections couldn't be removed. Switch to three
independent [start,end] pairs (6 handles) so each clip is framed on its own and
the gaps between them are dropped.
- audio_ops.py: new split_spans() — cuts 3 clips from [b0,b1,m0,m1,e0,e1],
start<=end per clip, each still silence-trimmed at its own edges.
- reviewer/app.py: /api/resplit accepts {spans:[...6]} (legacy {edges:[...4]}
still works); stores audio_state.spans.
- reviewer/static/index.html: timeline now shows one band per clip with two
colour-matched handles each (blue=beginning, green=middle, orange=end);
handles clamp to neighbours (order kept, gaps allowed); seeded from the
existing 4 edges; re-split posts spans.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Pages photographed at an angle / not scanned flat can't be framed by an
axis-aligned rectangle without losing detail. Add an optional "Free corners"
mode (off by default): each part's 4 corners move independently to trace the
skewed region, which is perspective-warped to a square tile.
- image_ops.py: new retile_quads() (cv2.getPerspectiveTransform + warpPerspective,
corners TL,TR,BR,BL -> out_size square) + optional `quads` field on ImageState.
- reviewer/app.py: /api/retile accepts {quads:{top,middle,bottom}} (each 4 pts);
switching back to boxes/box clears quads.
- reviewer/static/index.html: "Free corners" toggle (implies independent mode),
polygon editor with 4 free corner handles per part, seeded from the rect boxes,
persisted per id. Rectangles remain the default.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewer UX improvements, in two commits.
1. Independent per-part crop boxes
The reviewer modelled each page as a single 1:3 box sliced into three equal stacked squares — great for an upright workbook character, but unusable for
plain/panel-not-detectedpages where head, torso, and legs are separate drawings scattered around the sheet. Adds an Independent boxes mode: three colour-coded crop boxes (🔵 top/head · 🟢 middle/torso · 🟠 bottom/legs) that each move and resize freely, anywhere on the page, cropping to their own 1024×1024 opaque tile.scripts/image_ops.py— newretile_boxes()+ optionalboxesfield onImageState.reviewer/app.py—/api/retileaccepts{boxes:{top,middle,bottom}}as well as{box:[...]}.reviewer/static/index.html— toggle, 3-box editor (drag/resize each, topmost-wins hit-testing), legend, persistence.2. Reviewer UX follow-ups
GET /api/waveform/{id}returns a down-sampled, normalised peak envelope, cached toaudio/waveform.json(librosa).Compatibility
process.py) unchanged — reviewer-side only.export.pyneeds no change (it copies the tile PNGs).image_state.jsonwithoutboxesloads fine; audio without a cached waveform computes on demand.🤖 Generated with Claude Code