Skip to content

Open-Sora: Democratizing Efficient Video Production for All

Python

enable i2v, change log dir

Shen-Chenhui89617c94d1da
diff --git a/eval/sample.sh b/eval/sample.sh
index 0eae70d..dd1bd2f 100644
--- a/eval/sample.sh
+++ b/eval/sample.sh
@@ -212,7 +212,6 @@ function run_vbenck_h() { # 2h
# vbench-i2v has 1120 samples
-VBENCH_I2V_FRAMES=16
VBENCH_I2V_H=256
VBENCH_I2V_W=256
@@ -220,56 +219,56 @@ function run_vbenck_i2v_a() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 0 --end-index 140 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_b() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 140 --end-index 280 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_c() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 280 --end-index 420 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_d() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 420 --end-index 560 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_e() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 560 --end-index 700 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_f() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 700 --end-index 840 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_g() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 840 --end-index 980 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
function run_vbenck_i2v_h() {
eval $CMD_REF --ckpt-path $CKPT --save-dir ${OUTPUT}_vbench_i2v --prompt-as-path --num-sample 5 \
--prompt-path assets/texts/VBench/all_i2v.txt \
--start-index 980 \
- --num-frames $VBENCH_I2V_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
+ --num-frames $NUM_FRAMES --image-size $VBENCH_I2V_H $VBENCH_I2V_W --batch-size $VBENCH_BS
}
### Main
diff --git a/eval/vbench_i2v/launch.sh b/eval/vbench_i2v/launch.sh
index 1c07a71..3b0ee47 100644
--- a/eval/vbench_i2v/launch.sh
+++ b/eval/vbench_i2v/launch.sh
@@ -4,6 +4,7 @@ set -x
set -e
CKPT=$1
+NUM_FRAMES=51
MODEL_NAME=$2
if [[ $CKPT == *"ema"* ]]; then
@@ -12,12 +13,16 @@ if [[ $CKPT == *"ema"* ]]; then
else
CKPT_BASE=$(basename $CKPT)
fi
-LOG_BASE=logs/sample/${MODEL_NAME}_${CKPT_BASE}
+# LOG_BASE=logs/sample/${MODEL_NAME}_${CKPT_BASE}
+LOG_BASE={$CKPT}/eval
echo "Logging to $LOG_BASE"
-GPUS=(0 1 2 3 4 5 6 7)
-TASK_ID_LIST=(5a 5b 5c 5d 5e 5f 5g 5h)
+# GPUS=(0 1 2 3 4 5 6 7)
+# TASK_ID_LIST=(5a 5b 5c 5d 5e 5f 5g 5h)
+
+GPUS=(4 5 6 7)
+TASK_ID_LIST=(5e 5f 5g 5h)
for i in "${!GPUS[@]}"; do
- CUDA_VISIBLE_DEVICES=${GPUS[i]} bash eval/sample.sh $CKPT -${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
diff --git a/eval/vbench_i2v/vbench_i2v.py b/eval/vbench_i2v/vbench_i2v.py
index b021e43..9752404 100644
--- a/eval/vbench_i2v/vbench_i2v.py
+++ b/eval/vbench_i2v/vbench_i2v.py
@@ -4,4 +4,4 @@ VIDEO_PATH = ""
DIMENSIONS = ["i2v_subject", "i2v_background", "camera_motion"]
my_VBench = VBenchI2V("cuda", "vbench2_beta_i2v/vbench2_i2v_full_info.json", "evaluation_results")
-my_VBench.evaluate(videos_path=VIDEO_PATH, name="vbench_i2v", dimension_list=DIMENSIONS, resolution="1-1")
+my_VBench.evaluate(videos_path=VIDEO_PATH, name="vbench_i2v", dimension_list=DIMENSIONS, resolution="1-1")
\ No newline at end of file
diff --git a/eval/vbench_i2v/vbench_video_quality.py b/eval/vbench_i2v/vbench_video_quality.py
new file mode 100644
index 0000000..01be7bc
--- /dev/null
+++ b/eval/vbench_i2v/vbench_video_quality.py
@@ -0,0 +1,12 @@
+from vbench import VBench
+
+
+VIDEO_PATH = ""
+DIMENSIONS = ["subject consistency", "background_consistency", "motion_smoothness", "dynamic_degree", "aesthetic_quality", "imaging_quality"]
+
+my_VBench = VBench("cuda", "vbench2_beta_i2v/vbench2_i2v_full_info.json", "evaluation_results")
+my_VBench.evaluate(
+ videos_path = VIDEO_PATH,
+ name = "vbench_video_quality",
+ dimension_list = DIMENSIONS,
+)
\ No newline at end of file