Skip to content

Commit 9d3f9d5

Browse files
committed
MILESTONE: evaluation finished
Co-authored-by: Andrea Settimi <[email protected]>
1 parent 201c1ed commit 9d3f9d5

File tree

7 files changed

+151
-96
lines changed

7 files changed

+151
-96
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pos_mean__stripe_low,pos_mean__stripe_high,pos_mean__ring_low,pos_mean__ring_high,pos_median__stripe_low,pos_median__stripe_high,pos_median__ring_low,pos_median__ring_high,pos_std__stripe_low,pos_std__stripe_high,pos_std__ring_low,pos_std__ring_high,pos_min__stripe_low,pos_min__stripe_high,pos_min__ring_low,pos_min__ring_high,pos_max__stripe_low,pos_max__stripe_high,pos_max__ring_low,pos_max__ring_high,rot_mean__stripe_low,rot_mean__stripe_high,rot_mean__ring_low,rot_mean__ring_high,rot_median__stripe_low,rot_median__stripe_high,rot_median__ring_low,rot_median__ring_high,rot_std__stripe_low,rot_std__stripe_high,rot_std__ring_low,rot_std__ring_high,rot_min__stripe_low,rot_min__stripe_high,rot_min__ring_low,rot_min__ring_high,rot_max__stripe_low,rot_max__stripe_high,rot_max__ring_low,rot_max__ring_high,tags_mean__stripe_low,tags_mean__stripe_high,tags_mean__ring_low,tags_mean__ring_high,tags_median__stripe_low,tags_median__stripe_high,tags_median__ring_low,tags_median__ring_high,tags_std__stripe_low,tags_std__stripe_high,tags_std__ring_low,tags_std__ring_high,tags_min__stripe_low,tags_min__stripe_high,tags_min__ring_low,tags_min__ring_high,tags_max__stripe_low,tags_max__stripe_high,tags_max__ring_low,tags_max__ring_high,time_tag_lowD_stripe,time_tag_lowD_ring,time_tag_highD_stripe,time_tag_highD_ring,time_mapping_lowD_stripe,time_mapping_lowD_ring,time_mapping_highD_stripe,time_mapping_highD_ring,time_traditional,time_layout,total_nbr_operations,
2+
0.00011872335898147254,-3.7475499177111866e-05,3.4510924137892736e-05,0.00033896062531618644,0.00010533922647239432,5.1977461406118934e-05,3.264479768889721e-05,2.324875106581787e-05,0.0007333755640075518,0.0006422418375242743,0.0005286182456948346,0.0009789179496128859,-0.0029605443056493507,-0.002624529539300176,-0.002827712675758486,-0.0008470611217176313,0.0023855409043621197,0.0011740890257785968,0.0012694811606316818,0.0054439148180361625,-0.00029724318379136406,-0.0013499527118857294,0.00013803191568475422,-0.0030169827280945773,-6.87149554160296e-05,3.644249478029851e-05,-5.323422483218789e-05,-3.902915495142937e-05,0.0026103434105462266,0.006659696344326049,0.003873719724396535,0.012417585678734418,-0.009649040902260984,-0.037743530100165505,-0.013042246610685211,-0.06771807797152234,0.005840753454015865,0.003430199696319231,0.021246102562876956,0.005595398845535191,7.174546820514824,7.207039974763153,13.82577171035175,7.9403154023247176,6.997963340122199,7.568198048083789,14.844939809335909,8.34147465437788,1.638125779569769,2.0612076195754843,5.261639228151985,2.205102485306456,3.3393627613674077,3.1415211970074814,3.9040129058277877,3.604317819854893,9.916401635620172,11.744347826086956,25.818805093046034,12.283993115318417,8.940000000000001,18.699999999999996,21.449999999999996,26.98,3.3,5.34,3.75,4.5200000000000005,35,22,1344.0,
Loading
Loading
Loading
Loading

eval/script/compute_overview.py

+39-15
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ def main(out_subdir : str,
7070
data_highD_stripe = io_stream.cvt_csv_summary_to_data(csv_paths=csv_sequ_paths_highD_stripe)
7171
data_highD_ring = io_stream.cvt_csv_summary_to_data(csv_paths=csv_sequ_paths_highD_ring)
7272

73+
# total number of operations analysed
74+
total_nbr_operations : int = 0
75+
data1 = data_lowD_stripe[0]
76+
data2 = data_highD_stripe[0]
77+
data3 = data_lowD_ring[0]
78+
data4 = data_highD_ring[0]
79+
for i in range(data1.__len__()):
80+
total_nbr_operations += data1[i]
81+
total_nbr_operations += data2[i]
82+
total_nbr_operations += data3[i]
83+
total_nbr_operations += data4[i]
84+
7385
# time parsing
7486
# # get the preparation times from videos and retain only the not pre-fabricated piece
7587
# # in-fact the comparison will not equal with the manual timing due to the fact that
@@ -145,7 +157,6 @@ def main(out_subdir : str,
145157
ytitle="Position drift (m)",
146158
xthick=0.001)
147159

148-
149160
# # rotation drift
150161
data_lowD_stripe_rot_np = np.array(data_lowD_stripe[7], dtype=float)
151162
data_highD_stripe_rot_np = np.array(data_highD_stripe[7], dtype=float)
@@ -180,21 +191,34 @@ def main(out_subdir : str,
180191
io_stream.save_graph(graph=graph_time, path=f"{out_subdir}/summary_time.png")
181192

182193
# #===========================================
183-
# #TODO:
184-
# # print csv + latex table (at least to have the main values like mean, median, std, min, max)
185-
# # - get also the total number of operations
186-
# # metrics.compute_summary_table
194+
# drop csv + latex table of the summary metrics
195+
196+
dict_res = metrics.compute_summary_table(pair_pos_stripe=pair_pos_stripe,
197+
pair_pos_ring=pair_pos_ring,
198+
pair_rot_stripe=pair_rot_stripe,
199+
pair_rot_ring=pair_rot_ring,
200+
pair_tags_stripe=pair_tags_stripe,
201+
pair_tags_ring=pair_tags_ring,
202+
mean_time_tag_lowD_stripe=mean_time_tag_lowD_stripe,
203+
mean_time_tag_lowD_ring=mean_time_tag_lowD_ring,
204+
mean_time_tag_highD_stripe=mean_time_tag_highD_stripe,
205+
mean_time_tag_highD_ring=mean_time_tag_highD_ring,
206+
mean_time_mapping_lowD_stripe=mean_time_mapping_lowD_stripe,
207+
mean_time_mapping_lowD_ring=mean_time_mapping_lowD_ring,
208+
mean_time_mapping_highD_stripe=mean_time_mapping_highD_stripe,
209+
mean_time_mapping_highD_ring=mean_time_mapping_highD_ring,
210+
total_nbr_operations=total_nbr_operations)
211+
212+
csv_path = os.path.join(out_subdir, "summary.csv")
213+
with open(csv_path, 'w') as f:
214+
for key, item in dict_res.items():
215+
f.write(f"{key};")
216+
f.write("\n")
217+
for key, item in dict_res.items():
218+
f.write(f"{item};")
219+
f.write("\n")
187220

188-
total_nbr_operations : int = 0
189-
# do a mass addition of the total number of operations
190-
for data in [data_lowD_stripe, data_highD_stripe, data_lowD_ring, data_highD_ring]:
191-
total_nbr_operations += int(data[0])
192-
print(f"total_nbr_operations: {total_nbr_operations}")
193-
194-
# create a new csv file in the out_subdir
195-
csv_summary_path : str = f"{out_subdir}/summary.csv"
196-
with open(csv_summary_path, 'w') as f:
197-
f.write("total_nbr_operations
221+
# #===========================================
198222

199223
return None
200224

eval/script/metrics.py

+110-81
Original file line numberDiff line numberDiff line change
@@ -482,97 +482,126 @@ def compute_average_summary_values(data : np.array(float)) -> np.array(float):
482482
avr_data.append(np.mean(param))
483483
return np.array(avr_data)
484484

485-
486485
def compute_summary_table(pair_pos_stripe : list[list[float]],
487486
pair_pos_ring : list[list[float]],
488487
pair_rot_stripe : list[list[float]],
489488
pair_rot_ring : list[list[float]],
490489
pair_tags_stripe : list[list[float]],
491490
pair_tags_ring : list[list[float]],
492-
pair_prep_time : list[list[float]]=None ## TODO: add!
493-
) -> list[float]:
491+
mean_time_tag_lowD_stripe : float,
492+
mean_time_tag_lowD_ring : float,
493+
mean_time_tag_highD_stripe : float,
494+
mean_time_tag_highD_ring : float,
495+
mean_time_mapping_lowD_stripe : float,
496+
mean_time_mapping_lowD_ring : float,
497+
mean_time_mapping_highD_stripe : float,
498+
mean_time_mapping_highD_ring : float,
499+
total_nbr_operations : int,
500+
pair_time_traditional : int=35,
501+
pair_time_layout : int=22,
502+
) -> dict:
494503
"""
495504
This function computes the values of the final evaluation table based
496505
on the averaged values (all tools values merged and averaged):
497506
- (A) position drift (mean, median, std, min, max)
498507
- (B) rotation drift (mean, median, std, min, max)
499508
- (C) nbr tags detected (mean, median, std, min, max)
500-
- (D) preparation time
509+
- (D) total time (means, traditional, layout)
510+
- (E) total number operations
501511
"""
502-
#TODO: missing time calcuation
503-
return [
504-
np.mean(pair_pos_stripe[0]), # pos_mean__stripe_low
505-
np.mean(pair_pos_stripe[1]), # pos_mean__stripe_high
506-
np.mean(pair_pos_ring[0]), # pos_mean__ring_low
507-
np.mean(pair_pos_ring[1]), # pos_mean__ring_high
508-
509-
np.median(pair_pos_stripe[0]), # pos_median__stripe_low
510-
np.median(pair_pos_stripe[1]), # pos_median__stripe_high
511-
np.median(pair_pos_ring[0]), # pos_median__ring_low
512-
np.median(pair_pos_ring[1]), # pos_median__ring_high
513-
514-
np.std(pair_pos_stripe[0]), # pos_std__stripe_low
515-
np.std(pair_pos_stripe[1]), # pos_std__stripe_high
516-
np.std(pair_pos_ring[0]), # pos_std__ring_low
517-
np.std(pair_pos_ring[1]), # pos_std__ring_high
518-
519-
np.min(pair_pos_stripe[0]), # pos_min__stripe_low
520-
np.min(pair_pos_stripe[1]), # pos_min__stripe_high
521-
np.min(pair_pos_ring[0]), # pos_min__ring_low
522-
np.min(pair_pos_ring[1]), # pos_min__ring_high
523-
524-
np.max(pair_pos_stripe[0]), # pos_max__stripe_low
525-
np.max(pair_pos_stripe[1]), # pos_max__stripe_high
526-
np.max(pair_pos_ring[0]), # pos_max__ring_low
527-
np.max(pair_pos_ring[1]), # pos_max__ring_high
528-
529-
np.mean(pair_rot_stripe[0]), # rot_mean__stripe_low
530-
np.mean(pair_rot_stripe[1]), # rot_mean__stripe_high
531-
np.mean(pair_rot_ring[0]), # rot_mean__ring_low
532-
np.mean(pair_rot_ring[1]), # rot_mean__ring_high
533-
534-
np.median(pair_rot_stripe[0]), # rot_median__stripe_low
535-
np.median(pair_rot_stripe[1]), # rot_median__stripe_high
536-
np.median(pair_rot_ring[0]), # rot_median__ring_low
537-
np.median(pair_rot_ring[1]), # rot_median__ring_high
538-
539-
np.std(pair_rot_stripe[0]), # rot_std__stripe_low
540-
np.std(pair_rot_stripe[1]), # rot_std__stripe_high
541-
np.std(pair_rot_ring[0]), # rot_std__ring_low
542-
np.std(pair_rot_ring[1]), # rot_std__ring_high
543-
544-
np.min(pair_rot_stripe[0]), # rot_min__stripe_low
545-
np.min(pair_rot_stripe[1]), # rot_min__stripe_high
546-
np.min(pair_rot_ring[0]), # rot_min__ring_low
547-
np.min(pair_rot_ring[1]), # rot_min__ring_high
548-
549-
np.max(pair_rot_stripe[0]), # rot_max__stripe_low
550-
np.max(pair_rot_stripe[1]), # rot_max__stripe_high
551-
np.max(pair_rot_ring[0]), # rot_max__ring_low
552-
np.max(pair_rot_ring[1]), # rot_max__ring_high
553-
554-
np.mean(pair_tags_stripe[0]), # tags_mean__stripe_low
555-
np.mean(pair_tags_stripe[1]), # tags_mean__stripe_high
556-
np.mean(pair_tags_ring[0]), # tags_mean__ring_low
557-
np.mean(pair_tags_ring[1]), # tags_mean__ring_high
558-
559-
np.median(pair_tags_stripe[0]), # tags_median__stripe_low
560-
np.median(pair_tags_stripe[1]), # tags_median__stripe_high
561-
np.median(pair_tags_ring[0]), # tags_median__ring_low
562-
np.median(pair_tags_ring[1]), # tags_median__ring_high
563-
564-
np.std(pair_tags_stripe[0]), # tags_std__stripe_low
565-
np.std(pair_tags_stripe[1]), # tags_std__stripe_high
566-
np.std(pair_tags_ring[0]), # tags_std__ring_low
567-
np.std(pair_tags_ring[1]), # tags_std__ring_high
568-
569-
np.min(pair_tags_stripe[0]), # tags_min__stripe_low
570-
np.min(pair_tags_stripe[1]), # tags_min__stripe_high
571-
np.min(pair_tags_ring[0]), # tags_min__ring_low
572-
np.min(pair_tags_ring[1]), # tags_min__ring_high
573-
574-
np.max(pair_tags_stripe[0]), # tags_max__stripe_low
575-
np.max(pair_tags_stripe[1]), # tags_max__stripe_high
576-
np.max(pair_tags_ring[0]), # tags_max__ring_low
577-
np.max(pair_tags_ring[1]) # tags_max__ring_high
578-
]
512+
dict_results = {
513+
# >>>>>>>>>>>>>> A >>>>>>>>>>>>>>>
514+
"pos_mean__stripe_low" : np.mean(pair_pos_stripe[0]),
515+
"pos_mean__stripe_high" : np.mean(pair_pos_stripe[1]),
516+
"pos_mean__ring_low" : np.mean(pair_pos_ring[0]),
517+
"pos_mean__ring_high" : np.mean(pair_pos_ring[1]),
518+
519+
"pos_median__stripe_low" : np.median(pair_pos_stripe[0]),
520+
"pos_median__stripe_high" : np.median(pair_pos_stripe[1]),
521+
"pos_median__ring_low" : np.median(pair_pos_ring[0]),
522+
"pos_median__ring_high" : np.median(pair_pos_ring[1]),
523+
524+
"pos_std__stripe_low" : np.std(pair_pos_stripe[0]),
525+
"pos_std__stripe_high" : np.std(pair_pos_stripe[1]),
526+
"pos_std__ring_low" : np.std(pair_pos_ring[0]),
527+
"pos_std__ring_high" : np.std(pair_pos_ring[1]),
528+
529+
"pos_min__stripe_low" : np.min(pair_pos_stripe[0]),
530+
"pos_min__stripe_high" : np.min(pair_pos_stripe[1]),
531+
"pos_min__ring_low" : np.min(pair_pos_ring[0]),
532+
"pos_min__ring_high" : np.min(pair_pos_ring[1]),
533+
534+
"pos_max__stripe_low" : np.max(pair_pos_stripe[0]),
535+
"pos_max__stripe_high" : np.max(pair_pos_stripe[1]),
536+
"pos_max__ring_low" : np.max(pair_pos_ring[0]),
537+
"pos_max__ring_high" : np.max(pair_pos_ring[1]),
538+
539+
# >>>>>>>>>>>>>> B >>>>>>>>>>>>>>>
540+
"rot_mean__stripe_low" : np.mean(pair_rot_stripe[0]),
541+
"rot_mean__stripe_high" : np.mean(pair_rot_stripe[1]),
542+
"rot_mean__ring_low" : np.mean(pair_rot_ring[0]),
543+
"rot_mean__ring_high" : np.mean(pair_rot_ring[1]),
544+
545+
"rot_median__stripe_low" : np.median(pair_rot_stripe[0]),
546+
"rot_median__stripe_high" : np.median(pair_rot_stripe[1]),
547+
"rot_median__ring_low" : np.median(pair_rot_ring[0]),
548+
"rot_median__ring_high" : np.median(pair_rot_ring[1]),
549+
550+
"rot_std__stripe_low" : np.std(pair_rot_stripe[0]),
551+
"rot_std__stripe_high" : np.std(pair_rot_stripe[1]),
552+
"rot_std__ring_low" : np.std(pair_rot_ring[0]),
553+
"rot_std__ring_high" : np.std(pair_rot_ring[1]),
554+
555+
"rot_min__stripe_low" : np.min(pair_rot_stripe[0]),
556+
"rot_min__stripe_high" : np.min(pair_rot_stripe[1]),
557+
"rot_min__ring_low" : np.min(pair_rot_ring[0]),
558+
"rot_min__ring_high" : np.min(pair_rot_ring[1]),
559+
560+
"rot_max__stripe_low" : np.max(pair_rot_stripe[0]),
561+
"rot_max__stripe_high" : np.max(pair_rot_stripe[1]),
562+
"rot_max__ring_low" : np.max(pair_rot_ring[0]),
563+
"rot_max__ring_high" : np.max(pair_rot_ring[1]),
564+
565+
# >>>>>>>>>>>>>> C >>>>>>>>>>>>>>>
566+
"tags_mean__stripe_low" : np.mean(pair_tags_stripe[0]),
567+
"tags_mean__stripe_high" : np.mean(pair_tags_stripe[1]),
568+
"tags_mean__ring_low" : np.mean(pair_tags_ring[0]),
569+
"tags_mean__ring_high" : np.mean(pair_tags_ring[1]),
570+
571+
"tags_median__stripe_low" : np.median(pair_tags_stripe[0]),
572+
"tags_median__stripe_high" : np.median(pair_tags_stripe[1]),
573+
"tags_median__ring_low" : np.median(pair_tags_ring[0]),
574+
"tags_median__ring_high" : np.median(pair_tags_ring[1]),
575+
576+
"tags_std__stripe_low" : np.std(pair_tags_stripe[0]),
577+
"tags_std__stripe_high" : np.std(pair_tags_stripe[1]),
578+
"tags_std__ring_low" : np.std(pair_tags_ring[0]),
579+
"tags_std__ring_high" : np.std(pair_tags_ring[1]),
580+
581+
"tags_min__stripe_low" : np.min(pair_tags_stripe[0]),
582+
"tags_min__stripe_high" : np.min(pair_tags_stripe[1]),
583+
"tags_min__ring_low" : np.min(pair_tags_ring[0]),
584+
"tags_min__ring_high" : np.min(pair_tags_ring[1]),
585+
586+
"tags_max__stripe_low" : np.max(pair_tags_stripe[0]),
587+
"tags_max__stripe_high" : np.max(pair_tags_stripe[1]),
588+
"tags_max__ring_low" : np.max(pair_tags_ring[0]),
589+
"tags_max__ring_high" : np.max(pair_tags_ring[1]),
590+
591+
# >>>>>>>>>>>>>> D >>>>>>>>>>>>>>>
592+
"time_tag_lowD_stripe" : mean_time_tag_lowD_stripe,
593+
"time_tag_lowD_ring" : mean_time_tag_lowD_ring,
594+
"time_tag_highD_stripe" : mean_time_tag_highD_stripe,
595+
"time_tag_highD_ring" : mean_time_tag_highD_ring,
596+
"time_mapping_lowD_stripe" : mean_time_mapping_lowD_stripe,
597+
"time_mapping_lowD_ring" : mean_time_mapping_lowD_ring,
598+
"time_mapping_highD_stripe" : mean_time_mapping_highD_stripe,
599+
"time_mapping_highD_ring" : mean_time_mapping_highD_ring,
600+
"time_traditional" : pair_time_traditional,
601+
"time_layout" : pair_time_layout,
602+
603+
# >>>>>>>>>>>>>> E >>>>>>>>>>>>>>>
604+
"total_nbr_operations" : total_nbr_operations
605+
}
606+
607+
return dict_results

0 commit comments

Comments
 (0)