Spaces:
Sleeping
Sleeping
File size: 1,269 Bytes
07c6a04 |
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 |
import argparse
import torch
from vbench import VBench
full_info_path = "./vbench/VBench_full_info.json"
dimensions = [
"subject_consistency",
"imaging_quality",
"background_consistency",
"motion_smoothness",
"overall_consistency",
"human_action",
"multiple_objects",
"spatial_relationship",
"object_class",
"color",
"aesthetic_quality",
"appearance_style",
"temporal_flickering",
"scene",
"temporal_style",
"dynamic_degree",
]
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument("--video_path", required=True, type=str)
args = parser.parse_args()
return args
if __name__ == "__main__":
args = parse_args()
save_path = args.video_path.replace("/samples/", "/vbench_out/")
kwargs = {}
kwargs["imaging_quality_preprocessing_mode"] = "longer" # use VBench/evaluate.py default
for dimension in dimensions:
my_VBench = VBench(torch.device("cuda"), full_info_path, save_path)
my_VBench.evaluate(
videos_path=args.video_path,
name=dimension,
local=False,
read_frame=False,
dimension_list=[dimension],
mode="vbench_standard",
**kwargs,
)
|