Spaces:
Running
Running
Commit History
-
rename: catch the CLI help + metadata docstring (The Describatron)
ClaudeFollow-up to the rebrand: the vgm --help text (user-facing) and the metadata module docstring still said VideoGuideMaker. https://claude.ai/code/session_01EM8jiYxdVFy1w3LeJ9GBJg1dd2955
-
Add skip_inverted_ocr flag to opt out of the inverted Tesseract pass
ClaudeThe inverted-binarization pass exists to recover white-on-coloured callout text the normal pass turns into noise, but on slides with no such callouts it just halves throughput and risks producing garbled near-duplicates of body text (filtered as of the previous fix). Add a per-job toggle that disables the inverted pass entirely: - ocr_frame(skip_inverted=True) returns only normal-pass output - PipelineInputs.skip_inverted_ocr threads it through the orchestrator - /jobs and /process endpoints accept skip_inverted_ocr as a form field - CLI exposes --skip-inverted-ocr on build and metadata - Upload page advanced settings include a "Skip inverted OCR pass" toggle - Job remembers the choice so the lazy /ocr endpoint stays consistent when the reviewer picks an alt frame in the editor355b428 -
Second-pass audit: SSE timing, OCR memory cap, filter robustness, CLI ordering
Claude- SSE generator now resets its idle timeout on every event received rather than measuring from job.created_at, so a healthy long-running job emitting periodic progress events isn't killed at the 30-min mark. Also re-checks job.status == "running" right before calling finish_error to avoid racing a finish_success that landed during the events.get timeout. - ocr._preprocess_for_ocr caps the post-upscale max dimension at 2400 px so an unusual input frame doesn't allocate huge intermediates (the subsequent adaptiveThreshold doubles the footprint again, and we run OCR concurrently across job + lazy-alt requests). - filter_instructor_frames now skips candidate paths that don't exist on disk. Previously is_instructor_frame returned False on a missing file (cv2.imread is None), which let phantom paths slip through into the editor's frame picker where /alts/ would then 404. - cli build: dump_metadata runs BEFORE rendering, not after, so a template / disk-write failure do…9d2a95f
-
Fix CLI audio output: inline for single, bundle for zip, schema round-trip
Clauderun_pipeline already slices per-segment audio and sets seg.audio_filename, and guide.html emits src="audio/..." when that field is present. But the CLI's build command never inlined audio for --format single nor passed result.audio_paths to bundle_zip() for --format zip — so: - 'vgm build --format single' produced HTML referencing audio/segment_0001.mp3 paths that didn't exist next to it, breaking the 'self-contained HTML' contract. - 'vgm build --format zip' produced a zip with the HTML but no audio/ folder, so the audio references 404'd on extraction. - 'vgm render-from-metadata' had no audio_filename in the metadata schema at all; round-tripping a previously-built guide silently lost the audio entirely. Fixes: - SegmentMetadata gains audio_filename + migration default. The save/load round-trip now preserves it (test guard). - metadata_to_segment loads audio from <frames_dir.parent>/audio/<fn> when inline_images=True (so render-from-metadata -…c4e5c07 -
Live progress bar (web SSE + CLI rich) and rename images dir to 'static'
ClaudePipeline progress ----------------- orchestrator.run_pipeline now accepts an optional ProgressCallback and emits ProgressEvent(percent, stage, message) at each major phase: scene_detect, filter, transcript, ocr (per-frame), render, done. Errors emit a final 'error' event so consumers always see a terminal state. Web UI ------ New POST /jobs spawns the pipeline in a background thread, returns {job_id, events_url, result_url} (HTTP 202). GET /events/{job_id} streams Server-Sent Events with progress payloads. GET /result/{job_id} hands back the prepared HTML or zip. The upload page (templates/index.html) now intercepts the form submit, hides the form, shows a <progress> element with stage chip + message, subscribes via EventSource, and on 'done' either navigates to the review HTML (review mode) or kicks off a download (single/zip). The original synchronous /process endpoint is kept for non-browser clients. CLI --- `vgm build` and `vgm export-metadata` now display a rich progress bar (…4b79268 -
Phase D: --min-gap, --max-frames, --skip-ocr flag parity
Claudedetect_and_extract now applies, after dedup: an optional min_gap_seconds filter (drops frames closer than N seconds to the previous kept one) and an optional max_frames cap (uniform-stride downsample preserving first + last). Both unlink the dropped frame files so the output folder stays clean. run_pipeline gains skip_ocr (sets ocr_text to "" on every segment) and the new scene-tuning fields. These are exposed as CLI flags (--min-gap, --max-frames, --skip-ocr) on both `vgm build` and `vgm export-metadata`, and as form fields on POST /process so the web UI can use them too. Verified: 37 pytest tests pass (4 new — min-gap drops close frames, max-frames downsamples uniformly preserving first+last, max-frames is a no-op under the limit, CLI build with --skip-ocr --max-frames 2 emits at most 2 segments with empty ocr_text). https://claude.ai/code/session_01G3XpEehfr9DnX9L7BahQ4Lfe75e0e -
Phase A: unified metadata schema + vgm CLI
ClaudeAdd a pydantic-backed PageMetadata schema (app/pipeline/metadata.py) with KeyTerm and MathEquation models, plus dump/load/migrate helpers. Existing browser-editor `.edits.json` is upgraded to schema v2 by migrate_v1_to_v2 — old saves still load. Extract the FastAPI handler body into a shared run_pipeline helper in app/pipeline/orchestrator.py so the same orchestration is reused by the new vgm CLI (typer-based). Subcommands: build, export-metadata, render-from-metadata; the last one re-renders HTML from the JSON exported by either the editor or the CLI. Segment now carries optional key_terms / math_equations / include fields and a new render_from_metadata function turns a PageMetadata back into renderable Segments. render_guide / render_review accept subtitle, module, mathjax, and mathjax_src so subsequent phases (math equations, key terms) just need template + UI work. Verified: all 30 pytest tests pass, including a round-trip test that runs the full pipeline on smaller.m4v + M14_L3…2636772