-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrun_overall.sh
More file actions
84 lines (58 loc) · 1.69 KB
/
run_overall.sh
File metadata and controls
84 lines (58 loc) · 1.69 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# start_time
start_time=$(date +%s)
# mode (EN/ZH)
MODE=EN
# image_root_dir
IMAGE_DIR=""
# model list
MODEL_NAMES=("janus-pro")
# model_names=("gpt-4o" "imagen4")
# image grid
IMAGE_GRIDS=("2,2")
# IMAGE_GRIDS=("2,2" "1,4")
echo "Running all evaluation scripts"
pip install transformers==4.50.0
# Alignment Score
echo "It's alignment time."
python -m scripts.alignment.alignment_score \
--mode "$MODE" \
--image_dirname "$IMAGE_DIR" \
--model_names "${MODEL_NAMES[@]}" \
--image_grid "${IMAGE_GRID[@]}" \
--class_items "anime" "human" "object" \
# In ZH mode, the class_items list can be extended to include "multilingualism".
# Text Score
echo "It's text time."
python -m scripts.text.text_score \
--mode "$MODE" \
--image_dirname "$IMAGE_DIR/text" \
--model_names "${MODEL_NAMES[@]}" \
--image_grid "${IMAGE_GRID[@]}" \
# Diversity Score
echo "It's diversity time."
python -m scripts.diversity.diversity_score \
--mode "$MODE" \
--image_dirname "$IMAGE_DIR" \
--model_names "${MODEL_NAMES[@]}" \
--image_grid "${IMAGE_GRID[@]}" \
--class_items "anime" "human" "object" "text" "reasoning" \
# Style Score
echo "It's style time."
python -m scripts.style.style_score \
--mode "$MODE" \
--image_dirname "$IMAGE_DIR/anime" \
--model_names "${MODEL_NAMES[@]}" \
--image_grid "${IMAGE_GRID[@]}" \
# Reasoning Score
echo "It's reasoning time."
python -m scripts.reasoning.reasoning_score \
--mode "$MODE" \
--image_dirname "${IMAGE_DIR}/reasoning" \
--model_names "${MODEL_NAMES[@]}" \
--image_grid "${IMAGE_GRID[@]}" \
rm -rf tmp_*
# end_time
end_time=$(date +%s)
duration=$((end_time - start_time))
echo "✅ All evaluations finished in $duration seconds."