-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquick_sample_benchmark.py
More file actions
78 lines (63 loc) · 1.63 KB
/
quick_sample_benchmark.py
File metadata and controls
78 lines (63 loc) · 1.63 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
'''
Author: WANG Maonan
Date: 2025-12-29
Description: 从生成的 VQA 问题中采样,创建 benchmark 数据集
Example of usage:
python quick_sample_benchmark.py \
--source_root /path/to/source \
--output_root /path/to/output \
--timestep_start 200 \
--timestep_end 550 \
--random_seed 123
'''
import argparse
from sample_benchmark import BenchmarkGenerator
def parse_args():
"""解析命令行参数"""
parser = argparse.ArgumentParser(
description='从生成的 VQA 问题中采样,创建 benchmark 数据集'
)
parser.add_argument(
'--source_root',
type=str,
help='源数据根目录路径'
)
parser.add_argument(
'--output_root',
type=str,
help='输出根目录路径'
)
parser.add_argument(
'--timestep_start',
type=int,
default=100,
help='时间步范围起始值'
)
parser.add_argument(
'--timestep_end',
type=int,
default=550,
help='时间步范围结束值'
)
parser.add_argument(
'--random_seed',
type=int,
default=42,
help='随机种子'
)
return parser.parse_args()
def main():
"""主函数"""
# 解析命令行参数
args = parse_args()
# 创建生成器
generator = BenchmarkGenerator(
source_root=args.source_root,
output_root=args.output_root,
timestep_range=(args.timestep_start, args.timestep_end),
random_seed=args.random_seed
)
# 生成 benchmark
generator.generate()
if __name__ == '__main__':
main()