| |
| """Part2 source_folder 与 recheck 一致性检查。""" |
| import json |
| import os |
| import sys |
| from pathlib import Path |
|
|
| def main(): |
| cambw_root = os.environ.get("CAMBW_ROOT") or str(Path(__file__).resolve().parent.parent) |
| bench_dir = os.path.join(cambw_root, "benchmark_single") |
| part2_path = os.path.join(bench_dir, "part2_short_videos_-_place_&_motion.json") |
| eval_path = os.path.join(cambw_root, "eval_cambw.py") |
| if not os.path.isfile(part2_path): |
| print("Error: Part2 JSON not found:", part2_path, file=sys.stderr) |
| sys.exit(1) |
| with open(part2_path, encoding="utf-8") as f: |
| data = json.load(f) |
| part2_source = None |
| for v in data.get("videos") or []: |
| sf = v.get("source_folder") |
| if sf: |
| part2_source = sf |
| break |
| recheck_expected = "top20merge_full/corrected_json_2" |
| print("Part2 source_folder:", repr(part2_source)) |
| print("Recheck 源 (中短视频):", recheck_expected) |
| if part2_source != recheck_expected: |
| print("结论: 不一致。建议从 top20merge_full/corrected_json_2 重新生成 Part2 benchmark。") |
| else: |
| print("结论: 一致。") |
| if os.path.isfile(eval_path): |
| with open(eval_path, encoding="utf-8") as f: |
| text = f.read() |
| if "top20merge_full/corrected_json_2" in text and "top20merge_0207_persp" in text: |
| print("eval_cambw.py: 已包含 top20merge_full/corrected_json_2 -> top20merge_0207_persp 映射。") |
| print("Done.") |
|
|
| if __name__ == "__main__": |
| main() |
|
|