mirror of
https://github.com/hpcaitech/Open-Sora.git
synced 2026-05-21 11:59:01 +02:00
format
This commit is contained in:
parent
e852466200
commit
16866a4b32
|
|
@ -65,6 +65,28 @@ DIM_WEIGHT = {
|
|||
"overall consistency": 1,
|
||||
}
|
||||
|
||||
ordered_scaled_res = [
|
||||
"total score",
|
||||
"quality score",
|
||||
"semantic score",
|
||||
"subject consistency",
|
||||
"background consistency",
|
||||
"temporal flickering",
|
||||
"motion smoothness",
|
||||
"dynamic degree",
|
||||
"aesthetic quality",
|
||||
"imaging quality",
|
||||
"object class",
|
||||
"multiple objects",
|
||||
"human action",
|
||||
"color",
|
||||
"spatial relationship",
|
||||
"scene",
|
||||
"appearance style",
|
||||
"temporal style",
|
||||
"overall consistency",
|
||||
]
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
@ -116,9 +138,11 @@ if __name__ == "__main__":
|
|||
QUALITY_WEIGHT + SEMANTIC_WEIGHT
|
||||
)
|
||||
|
||||
formated_scaled_results = {}
|
||||
for key, val in scaled_results.items():
|
||||
formated_scaled_results[key] = format(val * 100, ".2f") + "%"
|
||||
formated_scaled_results = {"items": []}
|
||||
for key in ordered_scaled_res:
|
||||
# formated_scaled_results[key] = format(val * 100, ".2f") + "%"
|
||||
formated_score = format(scaled_results[key] * 100, ".2f") + "%"
|
||||
formated_scaled_results["items"].append({key: formated_score})
|
||||
|
||||
output_file_path = os.path.join(args.score_dir, "all_results.json")
|
||||
with open(output_file_path, "w") as outfile:
|
||||
|
|
|
|||
|
|
@ -53,19 +53,17 @@ if __name__ == "__main__":
|
|||
|
||||
if args.calc_i2v:
|
||||
my_VBench_I2V = VBenchI2V(torch.device("cuda"), full_info_path, output_dir)
|
||||
if args.end == -1: # adjust end accordingly
|
||||
args.end = len(i2v_dimensions)
|
||||
for i2v_dim in i2v_dimensions[args.start : args.end]:
|
||||
end = args.end if args.end != -1 else len(i2v_dimensions)
|
||||
for i2v_dim in i2v_dimensions[args.start : end]:
|
||||
my_VBench_I2V.evaluate(videos_path=video_path, name=i2v_dim, dimension_list=[i2v_dim], resolution="1-1")
|
||||
|
||||
kwargs = {}
|
||||
kwargs["imaging_quality_preprocessing_mode"] = "longer" # use VBench/evaluate.py default
|
||||
|
||||
if args.calc_quality:
|
||||
if args.end == -1: # adjust end accordingly
|
||||
args.end = len(video_quality_dimensions)
|
||||
my_VBench = VBench(torch.device("cuda"), full_info_path, output_dir)
|
||||
for quality_dim in video_quality_dimensions[args.start : args.end]:
|
||||
end = args.end if args.end != -1 else len(video_quality_dimensions)
|
||||
for quality_dim in video_quality_dimensions[args.start : end]:
|
||||
my_VBench.evaluate(
|
||||
videos_path=video_path, name=quality_dim, dimension_list=[quality_dim], mode="vbench_standard", **kwargs
|
||||
)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,22 @@ NORMALIZE_DIC_I2V = {
|
|||
"temporal_flickering": {"Min": 0.6293, "Max": 1.0},
|
||||
}
|
||||
|
||||
ordered_scaled_res = [
|
||||
"total score",
|
||||
"i2v score",
|
||||
"quality score",
|
||||
"camera_motion",
|
||||
"i2v_subject",
|
||||
"i2v_background",
|
||||
"subject_consistency",
|
||||
"background_consistency",
|
||||
"motion_smoothness",
|
||||
"dynamic_degree",
|
||||
"aesthetic_quality",
|
||||
"imaging_quality",
|
||||
"temporal_flickering",
|
||||
]
|
||||
|
||||
|
||||
def parse_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
|
|
@ -100,9 +116,10 @@ if __name__ == "__main__":
|
|||
I2V_QUALITY_WEIGHT + I2V_WEIGHT
|
||||
)
|
||||
|
||||
formated_scaled_results = {}
|
||||
for key, val in scaled_results.items():
|
||||
formated_scaled_results[key] = format(val * 100, ".2f") + "%"
|
||||
formated_scaled_results = {"item": []}
|
||||
for key in ordered_scaled_res:
|
||||
formated_res = format(scaled_results[key] * 100, ".2f") + "%"
|
||||
formated_scaled_results["item"].append({key: formated_res})
|
||||
|
||||
output_file_path = os.path.join(args.score_dir, "all_results.json")
|
||||
with open(output_file_path, "w") as outfile:
|
||||
|
|
|
|||
Loading…
Reference in a new issue