Spaces:
Sleeping
Sleeping
|
Download docs/implementation_plan.md from NamanBhatia-NB/ClipSense_AI: direct link, hf CLI and curl.
- Browser
- Download file 5.89 kB
-
https://huggingface.co/spaces/NamanBhatia-NB/ClipSense_AI/resolve/main/docs/implementation_plan.md
- Command line
-
hf download hf://spaces/NamanBhatia-NB/ClipSense_AI/docs/implementation_plan.md
-
curl -L -o implementation_plan.md https://huggingface.co/spaces/NamanBhatia-NB/ClipSense_AI/resolve/main/docs/implementation_plan.md
5.89 kB
A newer version of the Gradio SDK is available: 6.33.0
Implementation Plan - ClipSense Architecture & W1: Modular Architecture and Schemas
Architecture Overview
ClipSense is a multimodal video clipping system designed around four independent evidence experts, continuous floating-point temporal reasoning, and explicit code-level evidence arbitration:
Input Video
β
Multimodal Data Extraction
βββ Timestamped Transcript (WhisperX word alignments)
βββ Video Frames (Scene cuts + sampled frames)
βββ Audio Prosody (F0 pitch + RMS dynamics via Librosa/SciPy)
βββ Speaker / Conversation Information (Turn structure & pause timeline)
β
Four Independent Evidence Experts
βββ Transcript Expert (Semantic importance & contextual completeness)
βββ Visual Expert (Visual activity, shot pacing, pluggable representations)
βββ Prosody Expert (Acoustic emphasis, dynamic pitch variation)
βββ Conversation Expert (Conversational structure, turn exchanges)
β
Structured Temporal Evidence (Preserved independently; NO score collapse)
β
Evidence Aggregation & Auxiliary Normalization
(Continuous timestamps preserved; auxiliary temporal grid for indexing)
β
Multimodal Temporal Evidence Reasoner (MTER)
(Programmatic overlap/agreement, conflict analysis, semantic verification)
β
Final Temporal Boundaries
β
Temporal Boundary Refinement / Rule-Based Boundary Optimization
(Fine-grained adjustments, pause snapping, dead-air trimming)
β
Downstream Video Render (LR-ASD active speaker, 9:16 reframe, ASS subtitles, FFmpeg)
β
Final Short Clip
Alignment on Architectural Constraints
- Single Repository: Single ClipSense codebase; no baseline/research fragmentation.
- Four Independent Experts: Transcript, Visual, Prosody, and Conversation.
- No Premature Score Collapse: Expert outputs are kept as independent structured temporal proposals. No scalar aggregation before MTER.
- Authoritative Continuous Timestamps: Floating-point timestamps (
floatin seconds) are strictly preserved. The 1-second grid is strictly an auxiliary view. - Confidence Estimates: Terminology uses "confidence estimate" rather than calibrated probabilities.
- Configurable Baselines & Thresholds: No hard-coded research claims (e.g. pitch z-score > 2.0); all thresholds reside in
app/config.py. - Overlapping Proposals Allowed: Proposals from multiple experts can and should overlap for agreement analysis.
- Boundary Refinement: Termed "Temporal Boundary Refinement" or "Rule-based Boundary Optimization" (never "neurosymbolic").
- Semantic Completeness Criteria in MTER: Natural semantic start, sufficient context, key content retained, conversational payoff, no mid-sentence ending.
- Role Separation: MTER selects supported temporal regions; Boundary Optimizer performs fine-grained boundary adjustments.
- Programmatic MTER Pipeline: Overlap/agreement, conflict detection, proposal reconciliation, evidence-strength comparison, semantic verification, boundary selection.
- W1βW5 Scope:
- W1: Architecture + schemas
- W2: Multimodal extraction
- W3: Transcript + Conversation Experts
- W4: Visual + Prosody Experts
- W5: Common evidence bundle + timestamp normalization + MTER interface + deterministic prototype
- Honest Scope: No claims of full MTER implementation or performance improvements during W1βW5.
- No PyAnnote: Diarization and turn transitions derived from WhisperX and acoustic silences.
- Pluggable Visual Encoder: Abstract interface allowing interchangeable visual representations.
- No Unsupported Concepts: Avoid claims of virality prediction, emotion recognition, or viewer retention.
- Source Metadata:
TemporalProposalcarriesProposalSourceMetadatarecording source type, temporal resolution, and anchor. - W1 Implementation First: Implement only W1 now.
W1 Deliverables
backend/
core/schemas.py: Pydantic contracts for extraction, 4 independent experts, proposals, continuous timestamps, evidence bundles, and MTER criteria.app/config.py: Centralized configurable thresholds and baseline parameters.core/storage.py: Storage and ephemeral workspace management.pipeline/experts/base.py: Base expert contract and pluggable visual encoder protocol.pipeline/orchestrator.py: Pipeline orchestrator stub with invariant validation.tests/test_w1_architecture.py: Automated verification suite for W1 contracts.
W2 Deliverables
backend/
pipeline/extraction/transcript_extractor.py: WhisperX transcription and forced alignment with word-level continuous timestamps, speaker metadata, PyTorch 2.6+ checkpoint compatibility patch, and strict mode.pipeline/extraction/frame_extractor.py: Uniform frame sampling (1 fps) and scene cut detection preserving frame-level continuous timestamps.pipeline/extraction/prosody_extractor.py: Physical acoustic feature extraction (autocorrelation F0 pitch, RMS energy, dynamic range, voicing fraction, speaking rate) over continuous sliding windows.pipeline/extraction/conversation_extractor.py: Speaker turn parsing, silence gap boundaries (>0.7s), and dialogue exchange metrics with pause-based fallback.pipeline/extraction/extractor_pipeline.py: Pipeline coordinator with stage caching, deterministicmanifest.jsongeneration, terminal checkmarks ([β]), and timestamp duration validation.tests/test_w2_extractors.py: Unit tests for frame, prosody, and conversation extractors.tests/test_w2_smoke.py: End-to-end extraction pipeline smoke test.tests/run_representative_validation.py: Official strict-mode validation script on 90.0-second conversational sample (tests/sample_conversational_90s.mp4) with real WhisperX inference.