Browse Source

Update link save issue

Jérôme BUISINE 10 months ago
parent
commit
3a122070db
1 changed files with 6 additions and 4 deletions
  1. 6 4
      generate/generate_data_augmentation.py

+ 6 - 4
generate/generate_data_augmentation.py

@@ -188,22 +188,24 @@ def main():
                     for rotation in rotations:
 
                         rotated_img_name = extracted_image_name +  'rot' + str(rotation) + '_' + current_image_postfix + cfg.scene_image_extension
-                        rotated_img_path = os.path.join(folder_scene, rotated_img_name)
+                        rotated_img_path = os.path.join(output_scene_path, rotated_img_name)
+                        saved_rotated_img_path = os.path.join(folder_scene, rotated_img_name)
                         rotated_img = pil_extracted_img.rotate(rotation)
                         rotated_img.save(rotated_img_path)
 
-                        csv_line = folder_scene + ';' + str(final_threshold) + ';' + str(int(current_image_postfix)) + ';' + str(int(label_img)) + ';' + rotated_img_path + '\n'
+                        csv_line = folder_scene + ';' + str(final_threshold) + ';' + str(int(current_image_postfix)) + ';' + str(int(label_img)) + ';' + saved_rotated_img_path + '\n'
 
                         with open(output_dataset_filename_path, 'a') as f:
                             f.write(csv_line)
 
                 else:
                     extracted_image_name += current_image_postfix + cfg.scene_image_extension
-                    extracted_image_path = os.path.join(folder_scene, extracted_image_name)
+                    extracted_image_path = os.path.join(output_scene_path, extracted_image_name)
+                    saved_extracted_image_path = os.path.join(output_scene_path, extracted_image_name)
                     
                     pil_extracted_img.save(extracted_image_path)
 
-                    csv_line = folder_scene + ';' + str(final_threshold) + ';' + str(int(current_image_postfix)) + ';' + str(int(label_img)) + ';' + extracted_image_path + '\n'
+                    csv_line = folder_scene + ';' + str(final_threshold) + ';' + str(int(current_image_postfix)) + ';' + str(int(label_img)) + ';' + saved_extracted_image_path + '\n'
 
                     with open(output_dataset_filename_path, 'a') as f:
                         f.write(csv_line)