MCPcopy Create free account
hub / github.com/JasonLSC/GSCodec_Studio / compare_render_stats

Method compare_render_stats

examples/codec_ply_sequence.py:1071–1101  ·  view source on GitHub ↗

Compare rendering statistics between two sets of results. Args: stats1 (Dict): First set of rendering statistics stats2 (Dict): Second set of rendering statistics name1 (str): Name/label for the first set of statistics (default: "Original

(self, stats1: Dict, stats2: Dict, name1: str = "Original", name2: str = "Modified")

Source from the content-addressed store, hash-verified

1069 return seq_stats
1070
1071 def compare_render_stats(self, stats1: Dict, stats2: Dict, name1: str = "Original", name2: str = "Modified") -> None:
1072 """
1073 Compare rendering statistics between two sets of results.
1074
1075 Args:
1076 stats1 (Dict): First set of rendering statistics
1077 stats2 (Dict): Second set of rendering statistics
1078 name1 (str): Name/label for the first set of statistics (default: "Original")
1079 name2 (str): Name/label for the second set of statistics (default: "Modified")
1080
1081 The function prints a comparison of PSNR, SSIM, and LPIPS metrics for each frame
1082 and the average across all frames, showing the difference between the two sets.
1083 """
1084 print(f"\n=== Rendering Comparison: {name1} vs {name2} ===")
1085
1086 for frame_id in stats1.keys():
1087 if frame_id == "average":
1088 print("\n=== Average Metrics Comparison ===")
1089 else:
1090 print(f"\n=== Frame {frame_id} Comparison ===")
1091
1092 metrics1 = stats1[frame_id]
1093 metrics2 = stats2[frame_id]
1094
1095 for metric in ["psnr", "ssim", "lpips"]:
1096 value1 = metrics1[metric]
1097 value2 = metrics2[metric]
1098 diff = value2 - value1
1099 diff_str = f"+{diff:.4f}" if diff > 0 else f"{diff:.4f}"
1100
1101 print(f"{metric.upper():<8}: {value1:.4f} -> {value2:.4f} ({diff_str})")
1102
1103def create_dir(path):
1104 if os.path.exists(path):

Callers 1

mainFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected