Spaces:
Running
Running
Commit History
-
Topic primary picking: prefer clean slide content over borderline faces
ClaudeThe instructor filter drops frames where the face area exceeds the threshold, but borderline-face frames (e.g. a partial face at 8% of the image, below the 12% drop line) survive. With scene-based output that's fine — each scene becomes its own segment regardless. With topic segmentation, a topic can span several scenes, and the "longest on screen" pick promoted those borderline shots ahead of clean slides whose scenes were shorter. Have the instructor filter record each kept scene's measured face_area_ratio on the SceneFrame. _apply_topic_segmentation now partitions a topic's scenes into "slide content" (ratio < 0.03) and "borderline" pools and picks the longest from the slide-content pool first, only falling back to the borderline pool when the topic has no clean scenes at all. Borderline scenes still appear as switchable alternates in the editor — only the default anchor changes.5c072a9
-
Instructor filter: also filter alternates, promote first surviving alt
ClaudePreviously the filter only inspected each scene's primary frame, so a talking-head shot among the brightness-ranked alternates would still appear in the review picker. And when the primary itself was instructor- only, the entire segment was dropped instead of falling back to a salvageable alternate. Now every candidate (primary + alts) is classified; instructor frames are unlinked from disk, and the first surviving alternate is promoted to primary if needed. A segment is only dropped when every candidate is an instructor frame.8507c1a -
Instructor filter: prefer YuNet ONNX, Haar as fallback
ClaudeHaar's frontal-face cascade misses too many angled / hands-up / partly- occluded instructor frames; even with the multi-cascade extension, threshold sliders had no effect on undetected faces. YuNet (the small ~230 KB ONNX model bundled by the OpenCV Zoo) is far more robust to those conditions and one inference covers frontal + profile in any orientation. Wiring: app/pipeline/yunet.py — new module: * resolve_model_path() looks in (1) VGM_YUNET_MODEL env override, (2) bundled app/pipeline/models/, (3) ~/.cache/videoguidemaker/ models/. If none of those exist and allow_download=True, fetches from the opencv_zoo LFS media URL, validates SHA-256 + size to reject LFS pointer stubs (~130 B), and atomic-renames into the cache. Returns None if anything fails — the filter has a Haar fallback so this is non-fatal. * YuNetDetector.try_load() returns None on any error so callers can fall through. * largest_face_area() reuses the cv2.FaceDete…2619c42 -
Filter: detect instructor frames the frontal-face cascade misses
ClaudeFrontal-face Haar misses faces at angles, with hands raised, partly turned, or partly off-frame — so the threshold check never even fired for those frames and they slipped through regardless of how strict the slider was set. Now we run three cascades in sequence and take the largest detected region across all of them: - frontal face (existing — head-on shots) - profile face (instructor turned to one side; runs on both the image and its horizontal flip so either side is covered without doubling cascade count) - upper body (head + shoulders silhouette — robust when the face cascade fails because the angle, lighting, or partial occlusion blocks face detection but the silhouette is still obvious) The three cascades are parameterised individually (different min_neighbors / min_size) since upper-body benefits from stricter clustering and a larger min size to avoid false positiv…3a2f49a