diff --git a/stages/splitmerge.py b/stages/splitmerge.py index 92f18ba3..03173dd4 100644 --- a/stages/splitmerge.py +++ b/stages/splitmerge.py @@ -170,36 +170,36 @@ class ODMSplitStage(types.ODM_Stage): submodel_paths = [os.path.abspath(p) for p in mds.get_submodel_paths()] # Align -## octx.align_reconstructions(self.rerun()) + octx.align_reconstructions(self.rerun()) -## self.update_progress(55) + self.update_progress(55) # Aligned reconstruction is in reconstruction.aligned.json # We need to rename it to reconstruction.json remove_paths = [] -## for sp in submodel_paths: -## sp_octx = OSFMContext(sp) + for sp in submodel_paths: + sp_octx = OSFMContext(sp) -## aligned_recon = sp_octx.path('reconstruction.aligned.json') -## unaligned_recon = sp_octx.path('reconstruction.unaligned.json') -## main_recon = sp_octx.path('reconstruction.json') + aligned_recon = sp_octx.path('reconstruction.aligned.json') + unaligned_recon = sp_octx.path('reconstruction.unaligned.json') + main_recon = sp_octx.path('reconstruction.json') -## if io.file_exists(main_recon) and io.file_exists(unaligned_recon) and not self.rerun(): -## log.ODM_INFO("Submodel %s has already been aligned." % sp_octx.name()) -## continue + if io.file_exists(main_recon) and io.file_exists(unaligned_recon) and not self.rerun(): + log.ODM_INFO("Submodel %s has already been aligned." % sp_octx.name()) + continue -## if not io.file_exists(aligned_recon): -## log.ODM_WARNING("Submodel %s does not have an aligned reconstruction (%s). " -## "This could mean that the submodel could not be reconstructed " -## " (are there enough features to reconstruct it?). Skipping." % (sp_octx.name(), aligned_recon)) -## remove_paths.append(sp) -## continue + if not io.file_exists(aligned_recon): + log.ODM_WARNING("Submodel %s does not have an aligned reconstruction (%s). " + "This could mean that the submodel could not be reconstructed " + " (are there enough features to reconstruct it?). Skipping." % (sp_octx.name(), aligned_recon)) + remove_paths.append(sp) + continue -## if io.file_exists(main_recon): -## shutil.move(main_recon, unaligned_recon) + if io.file_exists(main_recon): + shutil.move(main_recon, unaligned_recon) -## shutil.move(aligned_recon, main_recon) -## log.ODM_INFO("%s is now %s" % (aligned_recon, main_recon)) + shutil.move(aligned_recon, main_recon) + log.ODM_INFO("%s is now %s" % (aligned_recon, main_recon)) # Remove invalid submodels submodel_paths = [p for p in submodel_paths if not p in remove_paths] @@ -362,4 +362,4 @@ class ODMMergeStage(types.ODM_Stage): log.ODM_INFO("Normal dataset, nothing to merge.") self.progress = 0.0 - + \ No newline at end of file