From f207000db84bad0fdc9824436cfd454ba64eee72 Mon Sep 17 00:00:00 2001 From: SVivdich02 Date: Wed, 15 May 2024 21:01:36 +0300 Subject: [PATCH] fixes --- experiment/main_calc_metrics_by_csv.py | 12 +++++++++--- experiment/main_kitti_processing.py | 6 ++++-- experiment/main_kitti_processing_metrics.py | 14 ++++++-------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/experiment/main_calc_metrics_by_csv.py b/experiment/main_calc_metrics_by_csv.py index e604b7c..598e136 100644 --- a/experiment/main_calc_metrics_by_csv.py +++ b/experiment/main_calc_metrics_by_csv.py @@ -58,17 +58,23 @@ def calculate_metrics(file_name): print( "precision={}, 1={}, 0={}".format( - sum_pres/float(len(values_pres)), pres1/float(len(values_pres)), pres0/float(len(values_pres)) + sum_pres/float(len(values_pres)), + pres1/float(len(values_pres)), + pres0/float(len(values_pres)), ) ) print( "recall={}, 1={}, 0={}".format( - sum_recall/float(len(values_recall)), recall1/float(len(values_recall)), recall0/float(len(values_recall)) + sum_recall/float(len(values_recall)), + recall1/float(len(values_recall)), + recall0/float(len(values_recall)), ) ) print( "fscore={}, 1={}, 0={}".format( - sum_fScore/float(len(values_fScore)), fscore1/float(len(values_fScore)), fscore0/float(len(values_fScore)) + sum_fScore/float(len(values_fScore)), + fscore1/float(len(values_fScore)), + fscore0/float(len(values_fScore)), ) ) diff --git a/experiment/main_kitti_processing.py b/experiment/main_kitti_processing.py index 4dafba6..9d358ba 100644 --- a/experiment/main_kitti_processing.py +++ b/experiment/main_kitti_processing.py @@ -196,8 +196,10 @@ def process_kitti( result_tuple = segment_pcds(config) - file_name = "experiment_2_a5b5_sem_voxel_offset0_T0l025/start{}_end{}.pickle".format( - config.start_index, config.end_index + file_name = ( + "experiment_2_a5b5_sem_voxel_offset0_T0l025/start{}_end{}.pickle".format( + config.start_index, config.end_index + ) ) new_file = open(file_name, "w") new_file.close() diff --git a/experiment/main_kitti_processing_metrics.py b/experiment/main_kitti_processing_metrics.py index bf6fc72..029ca88 100644 --- a/experiment/main_kitti_processing_metrics.py +++ b/experiment/main_kitti_processing_metrics.py @@ -73,10 +73,8 @@ def main(): start_index = current_from_num end_index = start_index + 4 - file_name = ( - "experiment_2_a5b5_sem_voxel_offset0_T0l025/start{}_end{}.pickle".format( - start_index, end_index - ) + file_name = "experiment_2_a5b5_sem_voxel_offset0_T0l025/start{}_end{}.pickle".format( + start_index, end_index ) with open(file_name, "rb") as file: @@ -91,9 +89,7 @@ def main(): ): # в облаке нет инстансов => пропускаем skipped += 1 print( - "start_index={}, end_index={} skip".format( - start_index, end_index - ) + "start_index={}, end_index={} skip".format(start_index, end_index) ) current_from_num = end_index continue @@ -119,7 +115,9 @@ def main(): pred_labels_unique.discard(0) with open( - "experiment_2_a5b5_sem_voxel_offset0_T0l025_{}.csv".format(instance_threshold), + "experiment_2_a5b5_sem_voxel_offset0_T0l025_{}.csv".format( + instance_threshold + ), "a", newline="", ) as file: