Skip to content

Optical flow–based preprocessing for filtering dynamic, motion-rich video clips.

Notifications You must be signed in to change notification settings

jieun-b/data-curation

Repository files navigation

Data Curation

This repository provides simple tools for filtering and extracting dynamic video sequences using optical flow magnitude.

Originally developed for the VoxCeleb dataset, but applicable to any frame-level video dataset with consistent naming (e.g., video_name/frame.png).

Scripts Overview

  • clip_level_filtering.py
    Extracts dynamic clips using a sliding window and merges overlapping segments.
    Output: filtered_dynamic_clips.csv

  • video_level_filtering.py
    Filters videos with low motion based on average optical flow score.
    Output: filtered_videos.csv, optical_flow_scores.csv

  • visualize_threshold_distribution.py
    Plots the number of videos above each threshold to guide cutoff selection.
    Output: optical_flow_threshold_plot.png

Input Format

<root_dir>/
├── id0001/
│   ├── 000.png
│   ├── 001.png
│   └── ...

Run scripts

Edit the ROOT_DIR and THRESHOLD values in each script, then run:

python clip_level_filtering.py
python video_level_filtering.py
python visualize_threshold_distribution.py

About

Optical flow–based preprocessing for filtering dynamic, motion-rich video clips.

Resources

Stars

Watchers

Forks

Languages