-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathevaluate.py
More file actions
47 lines (36 loc) · 1.01 KB
/
evaluate.py
File metadata and controls
47 lines (36 loc) · 1.01 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
import torch
import os
from vreason_bench import VReasonBench
from datetime import datetime
import argparse
import json
def parse_args():
parser = argparse.ArgumentParser(description='VReasonBench')
parser.add_argument(
"--task",
nargs='+',
required=True,
help="list of evaluation tasks, usage: --task <task_1> <task_2>",
)
parser.add_argument(
"--generated_videos",
type=str,
required=True,
help="path to directory containing generated videos",
)
return parser.parse_args()
def main():
args = parse_args()
print(f'args: {args}')
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
bench = VReasonBench(device)
print('start evaluation')
current_time = datetime.now().strftime('%Y-%m-%d-%H:%M:%S')
results = bench.evaluate(
name=f'results_{args.task}',
task_list=args.task,
video_dir=args.generated_videos,
)
print('Done!')
if __name__ == "__main__":
main()