File size: 1,781 Bytes
b635719
 
 
 
 
 
bc03b37
b635719
 
 
 
 
 
 
 
 
bc03b37
 
b635719
 
 
 
 
 
 
 
 
 
 
bc03b37
 
b635719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
"""
MVM² Benchmark Runner
Unified script to run evaluations on integrated research benchmarks.
"""
import os
import sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import argparse
import subprocess

def run_mathverse(limit=None):
    """Run MathVerse evaluation"""
    print("\n" + "="*50)
    print("[START] MathVerse Benchmark (ECCV 2024)")
    print("="*50)
    
    script_path = os.path.join(os.path.dirname(__file__), "evaluate_mathverse.py")
    cmd = [sys.executable, script_path]
    if limit:
        cmd.extend(["--limit", str(limit)])
        
    subprocess.run(cmd)

def run_mathv(limit=None):
    """Run MATH-V evaluation"""
    print("\n" + "="*50)
    print("[START] MATH-V Benchmark (NeurIPS 2024)")
    print("="*50)
    
    script_path = os.path.join(os.path.dirname(__file__), "evaluate_mathv.py")
    cmd = [sys.executable, script_path]
    if limit:
        cmd.extend(["--limit", str(limit)])
        
    subprocess.run(cmd)

def main():
    parser = argparse.ArgumentParser(description="Run MVM2 Research Benchmarks")
    parser.add_argument('benchmark', choices=['mathverse', 'mathv', 'all'], 
                      help="Benchmark to run")
    parser.add_argument('--limit', type=int, default=None, 
                      help="Limit number of samples (for testing)")
    
    args = parser.parse_args()
    
    # Check dependencies
    try:
        import datasets
    except ImportError:
        print("[ERROR] Missing dependency: 'datasets'")
        print("Please run: pip install datasets")
        return

    if args.benchmark in ['mathverse', 'all']:
        run_mathverse(args.limit)
        
    if args.benchmark in ['mathv', 'all']:
        run_mathv(args.limit)

if __name__ == "__main__":
    main()