Open-Sora/tools/scene_cut
xyupeng 0dfea90a89 Dev/pxy (#36)
update scoring & scene_cut
2024-04-06 16:33:06 +08:00
..
__init__.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
main_cut_multi_thread.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
main_cut_pandarallel.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
process_meta.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
README.md Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
scene_detect.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00
utils_video.py Dev/pxy (#36) 2024-04-06 16:33:06 +08:00

Scene Detection and Video Splitting

Formatting

Input meta should be {prefix}.csv with column 'videoId'

python tools/scene_cut/process_meta.py --task append_format --meta_path /mnt/hdd/data/pexels_new/raw/meta/popular_6.csv --split popular_6

Output is {prefix}_format.csv (with column path) and {prefix}_intact.csv (with column intact and path)

Scene Detection

Input meta should be {prefix}_format.csv

python tools/scene_cut/scene_detect.py --meta_path /mnt/hdd/data/pexels_new/raw/meta/popular_6_format.csv

Output is {prefix}_format_timestamp.csv

Video Splitting

Input meta should be {prefix}_timestamp.csv

python tools/scene_cut/main_cut_pandarallel.py \
    --meta_path /mnt/hdd/data/pexels_new/raw/meta/popular_6_format_timestamp.csv \
    --out_dir /mnt/hdd/data/pexels_new/scene_cut/data/popular_6

Output is {out_dir}/{wo_ext}_scene-{sid}.mp4

TODO: meta for video clips