Add scripts for preparing and extracting 5 FPS audio-video clips, including prepare_ego4d_2fps.py, run_extract_5fps_2pergpu.sh, and run_prepare_all_5fps.sh. Introduce streaming_turn_model_directly.py for direct extraction from original media. Update README.md to reflect changes in Qwen's streaming design and causal extraction modes. Add new AGENTS.md file for documentation.
This commit is contained in:
Executable
+63
@@ -0,0 +1,63 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
PROJECT_ROOT="${PROJECT_ROOT:-/data1/yfzx/wangx/Code/icassp2027-experiment}"
|
||||
VIDEO_ROOT="${VIDEO_ROOT:-/data1/yfzx/wangx/Datasets/easycom/extracted_easycom/Main/Video_Compressed}"
|
||||
TARGET_ROOT="${TARGET_ROOT:-${PROJECT_ROOT}/target_frame}"
|
||||
PREP_ROOT="${PREP_ROOT:-/data1/yfzx/wangx/Datasets/easycom/omni_prepared}"
|
||||
LOG_ROOT="${LOG_ROOT:-${PROJECT_ROOT}/logs/prepare_5fps}"
|
||||
|
||||
mkdir -p "${LOG_ROOT}"
|
||||
cd "${PROJECT_ROOT}"
|
||||
|
||||
prepare_worker() {
|
||||
local sid session session_dir target output_dir log
|
||||
for sid in "$@"; do
|
||||
session="Session_${sid}"
|
||||
session_dir="${VIDEO_ROOT}/${session}"
|
||||
target="${TARGET_ROOT}/${session}.npy"
|
||||
output_dir="${PREP_ROOT}/${session}"
|
||||
log="${LOG_ROOT}/${session}.log"
|
||||
|
||||
if [[ ! -d "${session_dir}" ]]; then
|
||||
echo "Missing source session: ${session_dir}" >&2
|
||||
return 1
|
||||
fi
|
||||
if [[ ! -s "${target}" ]]; then
|
||||
echo "Missing target: ${target}" >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
{
|
||||
echo "$(date): preparing ${session}"
|
||||
|
||||
python prepare_easycom_session.py \
|
||||
--session-dir "${session_dir}" \
|
||||
--output-dir "${output_dir}" \
|
||||
--target "${target}" \
|
||||
--fps 2 5 \
|
||||
--reuse-existing
|
||||
|
||||
echo "$(date): completed ${session}"
|
||||
} >"${log}" 2>&1
|
||||
done
|
||||
}
|
||||
|
||||
# FFmpeg/libx264 is already multithreaded. Two session workers generally make
|
||||
# better use of a many-core host without overwhelming storage or the CPU.
|
||||
prepare_worker 1 3 5 7 9 11 </dev/null &
|
||||
pid1=$!
|
||||
|
||||
prepare_worker 2 4 6 8 10 12 </dev/null &
|
||||
pid2=$!
|
||||
|
||||
status=0
|
||||
wait "${pid1}" || status=1
|
||||
wait "${pid2}" || status=1
|
||||
|
||||
if [[ "${status}" -ne 0 ]]; then
|
||||
echo "At least one preparation worker failed. Check ${LOG_ROOT}." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "ALL 12 SESSIONS PREPARED AT 2 FPS AND 5 FPS"
|
||||
Reference in New Issue
Block a user