Repository navigation
Keep subtitles off faces: anchor auto (T-5) - #61
Merged
Merged
Conversation
The subtitle anchor now defaults to "auto". For each cue, the frame at the cue's midpoint is read, faces are found with OpenCV's Haar cascade, and the least busy anchor whose caption box touches no face is used. The audit records the anchor, the faces seen, and whether the caption is clear. Without OpenCV, or if the frame cannot be read, it falls back to bottom and the audit says why. Face finder: OpenCV's haarcascade_frontalface_default.xml, shipped in the opencv-python-headless 4.x wheel under Apache-2.0. YuNet was rejected: its training lineage includes WIDER FACE (CC BY-NC-ND, no commercial use). OpenCV 5 dropped the cascade files, so the transcribe extra pins <5. Haar is older and less accurate than neural detectors: it misses faces turned far to one side and some in poor light. The audit makes that visible per cue. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017qYKdYke3ySSZS76W9Tp34
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.
T-5: captions keep off faces
video subtitlesnow defaults toanchor="auto". For each cue, the frame at the cue's midpoint is read, faces are found, and the least busy anchor whose caption box touches no face is used. The audit (<name>.text_audit.json) records each cue's anchor, the faces seen, and whether the caption is clear.Face finder and licence
haarcascade_frontalface_default.xml, shipped in theopencv-python-headless4.x wheel under Apache-2.0. No model download.transcribeextra pinsopencv-python-headless>=4.10,<5. This is a new dependency;pyproject.tomlis kept in sync (test_pyproject_in_sync_with_requirements).Behaviour changes
auto(wasbottom). Without OpenCV, or if a frame cannot be read, it falls back tobottomand the audit says why. Nothing fails.anchoracceptsauto,top,center,bottom. An explicit anchor is kept and not checked.Limits
Tests
tests/test_faces.py: overlap rule; auto keeps the caption off a face (stubbed); auto falls back and says so without OpenCV; fixed anchor not checked; unknown anchor refused; real cascade finds no face in a blank frame (skipped without OpenCV 4.x).test_tool_optionsenum; catalog regenerated and--checkpasses;ruff checkandruff format --checkclean.test_video,test_catalog,test_tool_options,test_server,test_p6_install,test_caption_timing,test_faces: all pass (the real-cascade test passes with OpenCV 4.10.0.84).https://claude.ai/code/session_017qYKdYke3ySSZS76W9Tp34
Generated by Claude Code