Video anticipation evaluation using Meta's Perception-LM-3B model.
Download video clips from Google Drive:
# Install gdown
pip install gdown
# Download data (50 clips: clip_1 to clip_50)
gdown --folder https://drive.google.com/drive/folders/1SRnl8DgXYZ5k-sw0Q1a-DSn47VNSV0b0 -O test_clips/
Alternatively, download manually from: Google Drive Link
conda create -n meta_eval python=3.10
conda activate meta_eval
# PyTorch with CUDA 12.4 (adjust for your CUDA version)
pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
# Core packages
pip install transformers huggingface-hub decord accelerate timm av
# Install ffmpeg for video processing
conda install -c conda-forge ffmpeg -y
huggingface-cli login
# Enter your HF token when prompted
python inference.py
Modify video_path and query in the script as needed.
Evaluates short-term anticipation using two video segments:
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python eval_anticipation.py \
--clip_id clip_1 \
--t_ctx_start 00:00 \
--t_ant_start 00:05 \
--t_ant_end 00:10 \
--query "What objects are visible in the scene?"
Parameters:
--clip_id: Video clip ID (clip_1 to clip_50)--t_ctx_start: Context start time (MM:SS)--t_ant_start: Anticipation start time (MM:SS)--t_ant_end: Anticipation end time (MM:SS)--query: Question for context segmentExample:
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python eval_anticipation.py \
--clip_id clip_2 \
--t_ctx_start 00:10 \
--t_ant_start 00:20 \
--t_ant_end 00:30 \
--query "What is the person doing?"
Recommended num_frames based on GPU VRAM:
Adjust in scripts:
num_frames=16 # Change based on your GPU
For OOM errors:
num_framesmax_new_tokensPYTORCH_CUDA_ALLOC_CONF=expandable_segments:Truetorch.cuda.empty_cache()inference.py: Basic video inference scripteval_anticipation.py: Anticipation evaluation scripttest_clips/: Video data directory (50 clips)hf_token: HuggingFace token storage2 commits
Python
100.0%
Video anticipation evaluation using Meta's Perception-LM-3B model.
Download video clips from Google Drive:
# Install gdown
pip install gdown
# Download data (50 clips: clip_1 to clip_50)
gdown --folder https://drive.google.com/drive/folders/1SRnl8DgXYZ5k-sw0Q1a-DSn47VNSV0b0 -O test_clips/
Alternatively, download manually from: Google Drive Link
conda create -n meta_eval python=3.10
conda activate meta_eval
# PyTorch with CUDA 12.4 (adjust for your CUDA version)
pip install torch==2.6.0 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
# Core packages
pip install transformers huggingface-hub decord accelerate timm av
# Install ffmpeg for video processing
conda install -c conda-forge ffmpeg -y
huggingface-cli login
# Enter your HF token when prompted
python inference.py
Modify video_path and query in the script as needed.
Evaluates short-term anticipation using two video segments:
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python eval_anticipation.py \
--clip_id clip_1 \
--t_ctx_start 00:00 \
--t_ant_start 00:05 \
--t_ant_end 00:10 \
--query "What objects are visible in the scene?"
Parameters:
--clip_id: Video clip ID (clip_1 to clip_50)--t_ctx_start: Context start time (MM:SS)--t_ant_start: Anticipation start time (MM:SS)--t_ant_end: Anticipation end time (MM:SS)--query: Question for context segmentExample:
PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True python eval_anticipation.py \
--clip_id clip_2 \
--t_ctx_start 00:10 \
--t_ant_start 00:20 \
--t_ant_end 00:30 \
--query "What is the person doing?"
Recommended num_frames based on GPU VRAM:
Adjust in scripts:
num_frames=16 # Change based on your GPU
For OOM errors:
num_framesmax_new_tokensPYTORCH_CUDA_ALLOC_CONF=expandable_segments:Truetorch.cuda.empty_cache()inference.py: Basic video inference scripteval_anticipation.py: Anticipation evaluation scripttest_clips/: Video data directory (50 clips)hf_token: HuggingFace token storage2 commits
Python
100.0%