MCPcopy Create free account
hub / github.com/Speakn0w/RealChart2Code / get_gt_code_path

Function get_gt_code_path

RealChart2Code_eval/evaluate_task2.py:566–572  ·  view source on GitHub ↗

根据image_path获取对应的ground truth代码文件路径

(image_path: Path)

Source from the content-addressed store, hash-verified

564 }
565
566def get_gt_code_path(image_path: Path) -> Path:
567 """根据image_path获取对应的ground truth代码文件路径"""
568 # 将*_plot_*.png改为*_code_*.py
569 filename = image_path.name
570 # 替换plot为code,png为py
571 code_filename = filename.replace('_plot_', '_code_').replace('.png', '.py')
572 return image_path.parent / code_filename
573
574
575def read_gt_code(gt_code_path: Path) -> str:

Callers 1

run_benchmarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected