Skip to content

Commit

Permalink
WIP: working on eval
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Nov 18, 2024
1 parent 57d97b5 commit 9080ebf
Show file tree
Hide file tree
Showing 134 changed files with 237,187 additions and 4 deletions.
38 changes: 34 additions & 4 deletions eval/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def process_joint_face_id(df: pd.DataFrame, joint_face_id_col: str, beam_col: st

return df


# TODO: explain why we remove single joint faces (too precise due to registration pipeline)
def remove_single_joint_faces(df: pd.DataFrame, joint_label_col: str, beam_col: str) -> pd.DataFrame:
"""
Remove all rows where there is only a single joint face per joint. We do this because in our analysis methodology, every joint is registered
Expand All @@ -81,7 +83,8 @@ def main(
###################################################################################################
## Beams - Joint/JointFaces
###################################################################################################
# ======= importing data into memory =======
# =================================================================================================
# importing data into memory
folder_name_beams: str = "a_beams"
path_dir_beams: str = os.path.join(_path, folder_name_beams)

Expand All @@ -103,26 +106,53 @@ def main(
elif f.endswith('_jointfaces.csv'):
df_jointfaces_dataset = pd.concat([df_jointfaces_dataset, pandas_data_beam], ignore_index=True)

# ======= joint analysis =======
# =================================================================================================
# joint analysis
df_joints_dataset = clean_missing_data(df_joints_dataset)

err_joint_mean = np.mean(np.array(df_joints_dataset['mean'].tolist()))
err_joint_std = np.mean(np.array(df_joints_dataset['std_deviation'].tolist()))
err_joint_total_nbr = len(df_joints_dataset)

# ======= jointfaces analysis =======
# =================================================================================================
# jointfaces analysis
df_jointfaces_dataset = process_joint_face_id(df_jointfaces_dataset, 'joint_face id', 'beam_name')
df_jointfaces_dataset = remove_single_joint_faces(df_jointfaces_dataset, 'joint_label', 'beam_name')
df_jointfaces_dataset = clean_missing_data(df_jointfaces_dataset)

err_jointface_mean = np.mean(np.array(df_jointfaces_dataset['mean'].tolist()))
err_jointface_std = np.mean(np.array(df_jointfaces_dataset['std_deviation'].tolist()))

print(f"Total number of joint distances: {err_joint_total_nbr}")
"""
- possible info can be the angles of the joints? (not)
- TODO: for sure is the length of the beam that it's interesting to analyse in function
- TODO: we should try to analyse only the upper tower
"""


###################################################################################################
## Printing
###################################################################################################

print(f"Total number of joint evaluated: {err_joint_total_nbr}")
print(f"Average number faces per joint: {np.mean(df_jointfaces_dataset['joint_face_count'])}")
print(f"Mean of all joint distances: {err_joint_mean}±{err_joint_std}")
print(f"Mean of all jointfaces distances: {err_jointface_mean}±{err_jointface_std}")


###################################################################################################
## Printing
###################################################################################################
# create a double boxplot of the joint distances and jointfaces distances
fig, ax = plt.subplots()
ax.boxplot([df_joints_dataset['mean'], df_jointfaces_dataset['mean']], labels=['Location Error\n(Joint level)', 'Joint Quality\n(JointFace level)'])
ax.set_ylabel('Distance Error (m)')
ax.set_title('Scan-CAD Accuracy Evaluation')
plt.savefig(os.path.join(_output_path, f'boxplot_{__time_stamp__}.png'))
plt.show()



###################################################################################################
## Assembly
###################################################################################################
Expand Down
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/A001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/A002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/A003/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.3
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/AC02/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/AC03/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/AC04/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.62
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/B002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.24
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/B003/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.232
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/B004/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.832
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/BD01/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.340
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/BD02/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.037
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/BD04/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.015
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/C001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.605
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/C002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.6
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/C003/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.289
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/C004/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.011
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/CBD3/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.027
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/D002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.331
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/D003/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.344
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/D004/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.039
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/W001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.385
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/W002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.310
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/X001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.370
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/X002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.267
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/Y001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.370
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/Y002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.292
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/Z001/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.366
1 change: 1 addition & 0 deletions eval/test_data/full_tower/a_beams/Z002/length.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.259

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
beam id,min_deviation,max_deviation,std_deviation,rmse,mean
0,0.0,0.0143,0.0014,0.0024,0.0019
1,0.0,0.0125,0.0014,0.0022,0.0018
2,0.0,0.0183,0.0046,0.007,0.0053
3,0.0,0.0121,0.0021,0.0032,0.0024
4,0.0,0.0163,0.0022,0.0037,0.003
5,0.0,0.0137,0.002,0.0034,0.0028
6,0.0,0.0142,0.0017,0.0057,0.0054
7,0.0,0.0102,0.0017,0.0027,0.0021
8,0.0,0.0139,0.0012,0.0019,0.0015
9,0.0,0.0111,0.0017,0.0031,0.0026
10,0.0,0.0123,0.0022,0.0035,0.0028
11,0.0,0.0166,0.0015,0.0027,0.0022
12,0.0,0.0163,0.0031,0.0054,0.0044
13,0.0,0.0066,0.0011,0.0019,0.0015
14,0.0,0.0187,0.0015,0.0022,0.0016
15,0.0,0.0141,0.0041,0.0057,0.004
16,0.0,0.0138,0.002,0.0059,0.0056
17,0.0,0.0197,0.0017,0.0027,0.0021
18,0.0,0.0169,0.0044,0.0075,0.0061
19,0.0,0.013,0.0019,0.0032,0.0026
20,0.0001,0.0093,0.0006,0.0031,0.003
21,0.0,0.0184,0.0019,0.0035,0.0029
22,0.0,0.0173,0.0029,0.0056,0.0048
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
beam id,min_deviation,max_deviation,std_deviation,rmse,mean
0,0.0,0.0143,0.0014,0.0024,0.0019
Loading

0 comments on commit 9080ebf

Please sign in to comment.