Preprocesses a folder of video files into UUID-named clips suitable as target inputs for roop-unleashed-style face-swap. Counterpart to the faceset (source-side) tooling. work/video_target_pipeline.py — orchestration with subcommands scan / scenes / stage / merge / track / score / cut / report. Quality gates default to face-sets-can-handle-side-profile values (yaw<=75°, pitch<=45°, face_short>=80px, det>=0.5). Cross-track segment merge fuses adjacent-in-time tracks within the same scene up to 2s gap. Output organized into <output_dir>/<source_stem>/<uuid>.mp4 + <uuid>.json sidecar with full provenance. work/video_face_worker.py — Windows DML face detect+embed worker. Uses JSONL append-only for results.jsonl: a critical perf fix (re- serializing the monolithic 245MB results.json on every flush was the dominant cost in the first attempt, dropping throughput to 0.5 fps). Append-only got it to 13+ fps, ~7.5 fps cumulative across the first 6.18h batch. Also uses seek-once-per-video + sequential cap.grab() between samples to dodge cv2 per-sample seek pathology on long H.264. Legacy results.json is auto-migrated to .jsonl on first load. work/run_video_pipeline.sh — generic chain driver, parameterized via WORK / INPUT_DIR / OUTPUT_DIR / FILTER_FROM / SKIP_PATTERN / MAX_DUR / IDENTITY env vars. work/status_video_pipeline.sh — generic status helper. First production batch (ct_src_00050..00062, 13 files, 6.18h input): 600 emitted segments, 239.5min accepted content (64.6% of input), 254 segments built from >=2 tracks (cross-track merge), 1h43m wall clock. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
33 lines
875 B
Bash
Executable File
33 lines
875 B
Bash
Executable File
#!/bin/bash
|
|
# Generic status helper for run_video_pipeline.sh.
|
|
# Usage: bash status_video_pipeline.sh <log_file>
|
|
# Defaults to /opt/face-sets/work/logs/video_run.log if no arg.
|
|
|
|
LOG="${1:-/opt/face-sets/work/logs/video_run.log}"
|
|
|
|
if [ ! -f "$LOG" ]; then
|
|
echo "no log at $LOG yet"
|
|
exit 0
|
|
fi
|
|
|
|
echo "=== last 8 log lines ==="
|
|
tail -8 "$LOG"
|
|
echo
|
|
|
|
# worker progress
|
|
last=$(grep -E "^\[scan\] [0-9]+/[0-9]+" "$LOG" | tail -1)
|
|
if [ -n "$last" ]; then
|
|
echo "=== DML worker progress ==="
|
|
echo " $last"
|
|
fi
|
|
|
|
# total elapsed
|
|
start_epoch=$(head -1 "$LOG" | sed 's/.*\[\(.*\)\].*\[setup\].*/\1/' | xargs -I{} date -d "{}" +%s 2>/dev/null)
|
|
now_epoch=$(date +%s)
|
|
if [ -n "$start_epoch" ] && [ "$start_epoch" != "" ] 2>/dev/null; then
|
|
elapsed=$((now_epoch - start_epoch))
|
|
h=$((elapsed / 3600))
|
|
m=$(( (elapsed % 3600) / 60 ))
|
|
echo " elapsed: ${h}h${m}m"
|
|
fi
|