diff --git a/process/batch_processing.py b/process/batch_processing.py index e796e90ec7e7d847ab2c3493db949bfe2880c580..3cf48f0904b0c2a81deae9e380037b8b33885843 100755 --- a/process/batch_processing.py +++ b/process/batch_processing.py @@ -895,12 +895,7 @@ class BatchProcessing: settings.protocol.add_step(fn=fn_name, rec_names=rec_names, paths=paths_to_save, kwargs=process_utils.convert_kwargs_to_yaml(kwargs)) - if delete_previous: - for camn in range(1, self.nb_cam + 1): - if os.path.exists(save_process_paths[camn]) and rec_paths[camn] != save_process_paths[camn]: - shutil.rmtree(save_process_paths[camn], ignore_errors=True) - - elif os.path.exists(os.path.join(save_process_path, 'process_history.yaml')): + if not delete_previous and os.path.exists(os.path.join(save_process_path, 'process_history.yaml')): if fn_name not in ['enhance_contrast', 'enhance_brightness', 'enhance_sharpness', 'enhance_color', 'autocontrast', 'equalize', 'load_dlc', 'fit_skeleton']: print('>> {0} has been skipped because already processed and delete_previous = False'.format(main_rec_name)) @@ -1157,12 +1152,7 @@ class BatchProcessing: frames = {camn: recording.get(camn).get_numbers() for camn in range(1, self.nb_cam + 1)} - if delete_previous: - for camn in range(1, self.nb_cam + 1): - if os.path.exists(save_process_paths[camn]) and rec_paths[camn] != save_process_paths[camn]: - shutil.rmtree(save_process_paths[camn], ignore_errors=True) - - elif os.path.exists(os.path.join(save_process_path, 'process_history.yaml')): + if not delete_previous and os.path.exists(os.path.join(save_process_path, 'process_history.yaml')): print('>> {0} had already been processed, and thus as been skipped (delete_previous = False)') continue diff --git a/process/dlc_postprocessing.py b/process/dlc_postprocessing.py index ad01f81d03aa6efde713fc2ba18267b7c3dde47d..e991e3abecc374f78a0897092887b1def605b67e 100755 --- a/process/dlc_postprocessing.py +++ b/process/dlc_postprocessing.py @@ -709,7 +709,7 @@ def reverse_processes_2d_points(skeleton2d: Dict[str, any], settings: Settings, crop_width, crop_height = width_img, height_img if 'crop' in process_functions: - csv_path = glob.glob(os.path.join(track_path, rec_names[camn], f'cam{camn}', '*' + obj_name + '-2d_points.csv')) + csv_path = glob.glob(os.path.join(track_path, rec_names[main_camn], f'cam{camn}', '*' + obj_name + '-2d_points.csv')) pts_csv = np.genfromtxt(csv_path[0], delimiter=',', skip_header=0, names=True)