File size: 2,572 Bytes
5767e72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/bash

base_path="$1"

# Define the dimension list
dimensions=("subject_consistency" "background_consistency" "aesthetic_quality" "imaging_quality" "object_class" "multiple_objects" "color" "spatial_relationship" "scene" "temporal_style" "overall_consistency" "human_action" "temporal_flickering" "motion_smoothness" "dynamic_degree" "appearance_style")

# Corresponding folder names
folders=("subject_consistency" "scene" "overall_consistency" "overall_consistency" "object_class" "multiple_objects" "color" "spatial_relationship" "scene" "temporal_style" "overall_consistency" "human_action" "temporal_flickering" "subject_consistency" "subject_consistency" "appearance_style")

# Check if the necessary subdirectories exist in the base path
subdirs_found=false

for folder in "${folders[@]}"; do
    if [ -d "$base_path/$folder" ]; then
        subdirs_found=true
        break
    fi
done

# If subdirectories are found, evaluate them, otherwise use base_path
if [ "$subdirs_found" = true ]; then
    # Loop over each dimension and corresponding folder
    for i in "${!dimensions[@]}"; do
        dimension=${dimensions[i]}
        folder=${folders[i]}

        videos_path="${base_path}/${folder}"
        echo "Evaluating '$dimension' in $videos_path"

        # Check if the dimension is 'temporal_flickering' and add the static filter flag
        if [ "$dimension" == "temporal_flickering" ]; then
            python vbench2_beta_long/eval_long.py --videos_path $videos_path --dimension $dimension --mode 'long_vbench_standard' --dev_flag --static_filter_flag
        else
            python vbench2_beta_long/eval_long.py --videos_path $videos_path --dimension $dimension --mode 'long_vbench_standard' --dev_flag
        fi
    done
else
    # If no subdirectories are found, set videos_path to base_path
    videos_path="$base_path"
    echo "No subdirectories found. Using base path $videos_path for evaluation."

    # Run the evaluation
    for i in "${!dimensions[@]}"; do
        dimension=${dimensions[i]}
        echo "Evaluating '$dimension' in $videos_path"

        # Check if the dimension is 'temporal_flickering' and add the static filter flag
        if [ "$dimension" == "temporal_flickering" ]; then
            python vbench2_beta_long/eval_long.py --videos_path $videos_path --dimension $dimension --mode 'long_vbench_standard' --dev_flag --static_filter_flag
        else
            python vbench2_beta_long/eval_long.py --videos_path $videos_path --dimension $dimension --mode 'long_vbench_standard' --dev_flag
        fi
    done
fi