<jupyter_start><jupyter_text>Load Data<jupyter_code>df = pd.read_csv('../assets/results/results.csv')
seg_time = np.load(r"C:\Users\Jeremy\Documents\UMICH\Research\UnrealRooftopLanding\AirSimCollectData\LidarRoofManualTest\SegmentationInfer\timings.npy")
seg_time[0] = seg_time[1]

df['Segmentation'] = seg_time[:len(df)]
df['t_smoothing'] = df['t_laplacian'] + df['t_bilateral']
df['t_Polylidar3D'] = df['t_mesh'] + df['t_smoothing'] + df['t_fastga_total'] + df['t_polylidar_planepoly'] + df['t_polylidar_filter']
df['t_Total'] = df['t_Polylidar3D'] + df['Segmentation'] + df['t_polylabel'] + df['t_classify_pointcloud']
df.head()<jupyter_output><empty_output><jupyter_text>Specific IOUsHere are some handpicked IOUs for some visualized examples in the paper<jupyter_code>mask = (df['uid'] == 82) & (df['sub_uid'] == 1)
print(len(df))
df[mask]
uids = df['uid'].to_numpy()
print(len(np.unique(uids)) / 5)
33 * 5 * 2<jupyter_output>32.6<jupyter_text>Execution Time<jupyter_code>df_simple = df.rename(columns={"t_classify_pointcloud": "Classify", "t_Polylidar3D": "Polylidar", "t_polylabel": "Polylabel" })
df_simple_melt = df_simple.melt(id_vars=["uid", "sub_uid", "computer"],
                                value_vars=['Segmentation','Classify', 'Polylidar', 'Polylabel'],
                                var_name="Sub Algorithm", 
                                value_name="Execution Time (ms)")
g = sns.catplot(data=df_simple_melt, x='Sub Algorithm', hue='computer', y='Execution Time (ms)', kind='violin', legend_out=False)
g.savefig('../assets/imgs/alg_timings.pdf')
df_reduced = df_simple[['Segmentation', 'Classify', 'Polylidar', 'Polylabel', 't_Total']]
df_reduced.describe()<jupyter_output><empty_output><jupyter_text>Accuracy<jupyter_code>df = df.rename(columns={"pl_base_iou": "Polylidar3D", "pl_seg_infer_iou": "Semantic Polylidar3D"})
df_simple = df.melt(id_vars=["uid", "sub_uid"],
                                value_vars=['Polylidar3D', 'Semantic Polylidar3D'],
                                var_name="Algorithm", 
                                value_name="Intersection over Union (IOU)")
g = sns.displot(df_simple, x="Intersection over Union (IOU)", hue="Algorithm", fill=True, 
                kde=True, facet_kws=dict(legend_out=False), aspect=1.5)
g.savefig('../assets/imgs/compare_algs.pdf')
# Inspired from https://www.nature.com/articles/s41561-021-00693-5/figures/3
mask = df_simple['Algorithm'] == 'Polylidar3D'
df_baseline = df_simple[mask]
df_new = df_simple[~mask]
palette = sns.color_palette('muted', 2)
f, (ax_box_baseline, ax_box_new, ax_hist) = plt.subplots(3, sharex=True, gridspec_kw={"height_ratios": (0.075, 0.075, .85)})

g = sns.histplot(df_simple, x="Intersection over Union (IOU)", hue="Algorithm", fill=True, 
                kde=True, ax=ax_hist, legend=True)

sns.boxplot(data=df_baseline, x="Intersection over Union (IOU)", ax=ax_box_baseline, color=palette[0], whis=None, showfliers=False)
sns.boxplot(data=df_new, x="Intersection over Union (IOU)", ax=ax_box_new, color=palette[1], whis=None, showfliers=False)
ax_box_baseline.axis('off')
ax_box_new.axis('off')
f.tight_layout()
f.savefig('../assets/imgs/compare_algs_extra.pdf')
print(df_baseline['Intersection over Union (IOU)'].describe())
print()
print(df_new['Intersection over Union (IOU)'].describe())
f, (ax_box_baseline, ax_box_new, ax_hist) = plt.subplots(3, sharex=True, gridspec_kw={"height_ratios": (0.075, 0.075, .85)})

g = sns.histplot(df_simple, x="Intersection over Union (IOU)", hue="Algorithm", fill=True, 
                kde=True, ax=ax_hist, legend=True)

sns.pointplot(data=df_baseline, x="Intersection over Union (IOU)", ax=ax_box_baseline, color=palette[0], ci="sd")
sns.pointplot(data=df_new, x="Intersection over Union (IOU)", ax=ax_box_new, color=palette[1], ci="sd")
ax_box_baseline.axis('off')
ax_box_new.axis('off')
f.tight_layout()
f.savefig('../assets/imgs/compare_algs_extra_2.pdf')
## Cross Checking with the internal scipy function
from scipy import stats
t2, p2 = stats.ttest_ind(df_new['Intersection over Union (IOU)'], df_baseline['Intersection over Union (IOU)'], equal_var=True)
print("t = " + str(t2))
print("p = " + str(p2))<jupyter_output>t = 10.994697953086854
p = 6.420177887053354e-26
{'fraction_non_alphanumeric': 0.1702077431539188, 'fraction_numerical': 0.024787535410764873, 'mean_word_length': 5.53858024691358, 'pattern_counts': {'":': 7, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '421617', 'license': 'MIT', 'n_tokens_mistral': 1717, 'n_tokens_neox': 1614, 'n_words': 249, 'path': 'notebooks/AlgorithmAnalysis.ipynb', 'repo_name': 'JeremyBYU/UnrealRooftopLanding', 'size': '4236'}