This commit is contained in:
Shen-Chenhui 2024-06-06 03:34:41 +00:00
parent 9dc63b35ca
commit 01fee497f3
6 changed files with 21 additions and 14 deletions

4
.gitignore vendored
View file

@ -196,3 +196,7 @@ package.json
# PLLaVA
tools/caption/pllava_dir/PLLaVA/
# vbench
vbench
vbench2_beta_i2v

View file

@ -79,6 +79,8 @@ bash eval/vbench_i2v/launch.sh /path/to/ckpt num_frames model_name
python eval/vbench_i2v/vbench_i2v.py
# Step 3: obtain the scaled scores
def load_i2v_dimension_info(json_dir, dimension, lang, resolution):
# Note that if you need to go to `your_conda_env_path/lib/python3.x/site-packages/vbench2_beta_i2v/utils.py` and change the harded-coded var `image_root` in the `load_i2v_dimension_info` function to your appropriate image folder.
python eval/vbench_i2v/tabulate_vbench_i2v_scores.py --score_dir path/to/evaluation_results/dir
```

View file

@ -16,6 +16,7 @@ fi
# LOG_BASE=logs/samples/${MODEL_NAME}_${CKPT_BASE}
# mkdir -p logs/samples
LOG_BASE=$(dirname $CKPT)/eval
mkdir -p ${LOG_BASE}
echo "Logging to $LOG_BASE"
GPUS=(0 1 2 3 4 5 6 7)

View file

@ -17,7 +17,7 @@ else
fi
# LOG_BASE=logs/loss/${MODEL_NAME}_${CKPT_BASE}
# mkdir -p logs/loss
LOG_BASE=$(dirname $CKPT)/eval
LOG_BASE=$(dirname $CKPT_PATH)/eval
echo "Logging to $LOG_BASE"

View file

@ -4,8 +4,9 @@ set -x
set -e
CKPT=$1
MODEL_NAME=$2
NUM_FRAMES=$3
NUM_FRAMES=$2
MODEL_NAME=$3
if [[ $CKPT == *"ema"* ]]; then
parentdir=$(dirname $CKPT)
@ -13,12 +14,12 @@ if [[ $CKPT == *"ema"* ]]; then
else
CKPT_BASE=$(basename $CKPT)
fi
LOG_BASE=logs/sample/${MODEL_NAME}_${CKPT_BASE}
LOG_BASE=$(dirname $CKPT)/eval
echo "Logging to $LOG_BASE"
GPUS=(0 1 2 3 4 5 6 7)
TASK_ID_LIST=(4a 4b 4c 4d 4e 4f 4g 4h)
for i in "${!GPUS[@]}"; do
CUDA_VISIBLE_DEVICES=${GPUS[i]} bash eval/sample.sh $CKPT ${NUM_FRAMES} ${MODEL_NAME} -${TASK_ID_LIST[i]} >${LOG_BASE}_${TASK_ID_LIST[i]}.log 2>&1 &
CUDA_VISIBLE_DEVICES=${GPUS[i]} bash eval/sample.sh $CKPT ${NUM_FRAMES} ${MODEL_NAME} -${TASK_ID_LIST[i]} >${LOG_BASE}/${TASK_ID_LIST[i]}.log 2>&1 &
done

View file

@ -1,10 +1,9 @@
import argparse
import os
from vbench import VBench
from vbench2_beta_i2v import VBenchI2V
FULL_INFO_PATH = "vbench2_beta_i2v/vbench2_i2v_full_info.json"
FULL_INFO_PATH = "eval/vbench_i2v/vbench2_i2v_full_info.json"
VIDEO_QUALITY_DIMENSIONS = [
"subject_consistency",
"background_consistency",
@ -31,12 +30,12 @@ if __name__ == "__main__":
os.makedirs(output_dir, exist_ok=True)
video_path = args.video_folder
my_VBench_I2V = VBenchI2V("cuda", FULL_INFO_PATH, "evaluation_results")
my_VBench_I2V = VBenchI2V("cuda", FULL_INFO_PATH, output_dir)
my_VBench_I2V.evaluate(videos_path=video_path, name="vbench_i2v", dimension_list=I2V_DIMENSIONS, resolution="1-1")
my_VBench = VBench("cuda", FULL_INFO_PATH, output_dir)
my_VBench.evaluate(
videos_path=video_path,
name="vbench_video_quality",
dimension_list=VIDEO_QUALITY_DIMENSIONS,
)
# my_VBench = VBench("cuda", FULL_INFO_PATH, output_dir)
# my_VBench.evaluate(
# videos_path=video_path,
# name="vbench_video_quality",
# dimension_list=VIDEO_QUALITY_DIMENSIONS,
# )