diff --git a/opendm/osfm.py b/opendm/osfm.py index fd8235e5..28e02b95 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -156,12 +156,14 @@ class OSFMContext: True) tools.apply_transformations(transformations) - - with open(alignment_file, 'w') as fout: - fout.write("Alignment done!\n") + self.touch(alignment_file) else: log.ODM_WARNING('Found a alignment done progress file in: %s' % alignment_file) + def touch(self, file): + with open(file, 'w') as fout: + fout.write("Done!\n") + def path(self, *paths): return os.path.join(self.opensfm_project_path, *paths) diff --git a/stages/run_opensfm.py b/stages/run_opensfm.py index 3af20f34..3e555107 100644 --- a/stages/run_opensfm.py +++ b/stages/run_opensfm.py @@ -42,7 +42,10 @@ class ODMOpenSfMStage(types.ODM_Stage): else: output_file = tree.opensfm_reconstruction - octx.update_config({'undistorted_image_max_size': gsd.image_max_size(photos, args.orthophoto_resolution, tree.opensfm_reconstruction, ignore_gsd=args.ignore_gsd)}) + updated_config_flag_file = octx.path('updated_config.txt') + if not io.file_exists(updated_config_flag_file) or self.rerun(): + octx.update_config({'undistorted_image_max_size': gsd.image_max_size(photos, args.orthophoto_resolution, tree.opensfm_reconstruction, ignore_gsd=args.ignore_gsd)}) + octx.touch(updated_config_flag_file) # These will be used for texturing undistorted_images_path = octx.path("undistorted")