SAVVY-Bench / aea.sh
ZijunCui's picture
update the vrs processing pipeline
7544b8d
#!/bin/bash
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "SAVVY-Bench AEA Processing Script"
echo "================================="
# Check system requirements
echo "Checking system requirements..."
df -h . | tail -1 | awk '{print "Available disk space: " $4}'
echo "Estimated space needed: 350GB"
echo "Estimated processing time: 4-6 hours"
echo ""
# Check required files
if [ ! -d "${SCRIPT_DIR}/egolifter" ]; then
echo "Error: EgoLifter directory not found, please run: git submodule update --init --recursive"
exit 1
fi
if [ ! -f "${SCRIPT_DIR}/Aria Everyday Activities Dataset.json" ]; then
echo "Error: Configuration file 'Aria Everyday Activities Dataset.json' not found"
exit 1
fi
if [ ! -f "${SCRIPT_DIR}/aea/video_ids.txt" ]; then
echo "Error: Video ID file 'aea/video_ids.txt' not found"
exit 1
fi
# 1. Download all data
echo "Step 1/4: Downloading AEA data..."
python "${SCRIPT_DIR}/scripts/download_aea_videos.py"
# 2. Process all data (undistortion)
echo "Step 2/4: Processing data (undistortion)..."
python "${SCRIPT_DIR}/scripts/process_aea_data.py"
# 3. Extract audio
echo "Step 3/4: Extracting and processing audio (channels 5,6)..."
if python "${SCRIPT_DIR}/scripts/extract_vrs_audio.py" "${SCRIPT_DIR}/aea/video_ids.txt" "${SCRIPT_DIR}/aea/aea_data" "${SCRIPT_DIR}/aea/aea_processed"; then
echo "βœ“ Audio extraction completed"
else
echo "⚠ Audio extraction encountered issues, but continuing..."
fi
# 4. Convert videos
echo "Step 4/4: Converting undistorted frames to MP4..."
if python "${SCRIPT_DIR}/scripts/process_videos.py" "${SCRIPT_DIR}/aea/video_ids.txt" "${SCRIPT_DIR}/aea/aea_processed" "${SCRIPT_DIR}/aea/aea_processed"; then
echo "βœ“ Video conversion completed"
else
echo "⚠ Video conversion encountered issues, but continuing..."
fi
echo "All processing completed!"
echo "Data saved in: ${SCRIPT_DIR}/aea/aea_processed/"
echo "Structure:"
echo " aea/aea_processed/"
echo " β”œβ”€β”€ {video_id}/"
echo " β”‚ β”œβ”€β”€ audio/{video_id}.wav (channels 5,6)"
echo " β”‚ β”œβ”€β”€ video/{video_id}.mp4 (from undistorted frames)"
echo " β”‚ └── images/ (undistorted frames)"