| import os |
| import pandas as pd |
| from matplotlib import pyplot as plt, ticker |
|
|
| split = os.getenv('split', '') |
| suf_split = f'-{split}' if split else '' |
| RESULT_DIR = f'./results{suf_split}' |
|
|
| NAMES = { |
| |
| |
| 'Orienter (Gemini)': f'{RESULT_DIR}/realfse_union3_gemini15pro_ape_d_object_bbox_gpu0123_i_bf.csv', |
| |
| 'YOLOv8': f'{RESULT_DIR}/YOLO.csv', |
| 'Claude-4.5-sonnet': f'{RESULT_DIR}/Claude4_5-sonnet-E2E.csv', |
| 'InternVL 3.5': f'{RESULT_DIR}/internVL-E2E.csv', |
| |
| 'Random-based Fuzzing': f'{RESULT_DIR}/random.csv', |
| } |
|
|
| MARKERS = { |
| |
| |
| 'Orienter (Gemini)': 'D', |
| |
| 'YOLOv8': '*', |
| 'Claude-4.5-sonnet': 'P', |
| 'InternVL 3.5': 'v', |
| |
| 'Random-based Fuzzing': 'x', |
| } |
|
|
|
|
| def format_func(x, pos): |
| return format(int(x), ',').replace(',', ' ') |
|
|
|
|
| def plot_effective_interacts_cnt(data): |
| plt.figure() |
| ax = plt.gca() |
| plt.gcf().set_size_inches(8, 6) |
| ax.set_xlabel('Time/min') |
| ax.xaxis.set_major_locator(ticker.MultipleLocator(10)) |
| ax.set_ylabel('Effective Interactions') |
| ax.yaxis.set_major_locator(ticker.MultipleLocator(1000)) |
| ax.yaxis.set_major_formatter(ticker.FuncFormatter(format_func)) |
| for name, df in data.items(): |
| plt.plot(df.index, df['effective_interacts_cnt'], label=name, marker=MARKERS[name], markevery=10, linestyle='-' if name.startswith('Orienter') else '-', markersize=12) |
| |
| |
| |
| plt.savefig(f'{RESULT_DIR}/test-effective-interacts-cnt.png', dpi=300, bbox_inches='tight') |
| plt.savefig(f'{RESULT_DIR}/test-effective-interacts-cnt.pdf', dpi=300, bbox_inches='tight', format='pdf') |
|
|
|
|
| def plot_coverage_rate(data): |
| plt.figure() |
| ax = plt.gca() |
| plt.gcf().set_size_inches(8, 6) |
| ax.set_xlabel('Time/min') |
| ax.xaxis.set_major_locator(ticker.MultipleLocator(10)) |
| ax.set_ylabel('IGE Coverage') |
| ax.yaxis.set_major_locator(ticker.MultipleLocator(0.1)) |
| for name, df in data.items(): |
| plt.plot(df.index, df['coverage_rate'], label=name, marker=MARKERS[name], markevery=10, linestyle='-' if name.startswith('Orienter') else '-', markersize=12) |
| |
| plt.legend(loc='lower right', ncol=1, frameon=False, fontsize=19) |
| plt.savefig(f'{RESULT_DIR}/test-coverage-rate.png', dpi=300, bbox_inches='tight') |
| plt.savefig(f'{RESULT_DIR}/test-coverage-rate.pdf', dpi=300, bbox_inches='tight', format='pdf') |
|
|
|
|
| def main(): |
|
|
| plt.rcParams['font.size'] = 28 |
|
|
| |
| data = {} |
| for name, path in NAMES.items(): |
| data[name] = pd.read_csv(path) |
| data[name] = data[name][1:] |
|
|
| plot_effective_interacts_cnt(data) |
| plot_coverage_rate(data) |
|
|
|
|
| if __name__ == '__main__': |
| main() |
|
|