User Story
As a FrameStory user,
I want adaptive threshold calculation in extract_significant_frames
so that frame extraction accuracy improves across videos with varying lighting and motion dynamics.
Background
The current fixed threshold in video_describer.py (line 31: threshold=50000) causes inconsistent frame selection. Videos with rapid scene changes or subtle lighting variations either miss key frames (high threshold) or capture redundant ones (low threshold). This limitation is evident in extract_significant_frames where cv2.absdiff comparisons use a static value rather than adapting to content characteristics. Risks include inaccurate video summaries and reduced model training effectiveness if frame selection quality deteriorates.
Acceptance Criteria
User Story
As a FrameStory user,
I want adaptive threshold calculation in
extract_significant_framesso that frame extraction accuracy improves across videos with varying lighting and motion dynamics.
Background
The current fixed threshold in
video_describer.py(line 31:threshold=50000) causes inconsistent frame selection. Videos with rapid scene changes or subtle lighting variations either miss key frames (high threshold) or capture redundant ones (low threshold). This limitation is evident inextract_significant_frameswherecv2.absdiffcomparisons use a static value rather than adapting to content characteristics. Risks include inaccurate video summaries and reduced model training effectiveness if frame selection quality deteriorates.Acceptance Criteria
extract_significant_framesinframe_story/video_describer.pyto implement dynamic threshold calculationthresholdparameter with logic analyzing local frame differences (e.g., moving average of 5-frame window)adaptive=Trueparameter toVideoDescriber.__init__to enable/disable this featuretests/test_video_describer.pyto validate threshold adaptation using low-variation and high-variation test videosshow_progress=True