From 971a1fd29b223d31bde925c4ff0fe42fbfdcff28 Mon Sep 17 00:00:00 2001 From: Stephen Mather <1174901+smathermather@users.noreply.github.com> Date: Mon, 22 Jul 2024 09:16:15 -0400 Subject: [PATCH] Update logic to allow split default when path set (#1782) * Update logic to allow split default when path set * Fix default split-image-groups case --------- Co-authored-by: Piero Toffanin --- stages/splitmerge.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stages/splitmerge.py b/stages/splitmerge.py index fef7a2321..80e130978 100644 --- a/stages/splitmerge.py +++ b/stages/splitmerge.py @@ -29,14 +29,15 @@ def process(self, args, outputs): photos = reconstruction.photos outputs['large'] = False - should_split = len(photos) > args.split - - if should_split: - # check for availability of either image_groups.txt (split-merge) or geotagged photos - image_groups_file = os.path.join(args.project_path, "image_groups.txt") - if 'split_image_groups_is_set' in args: - image_groups_file = os.path.abspath(args.split_image_groups) - if io.file_exists(image_groups_file) or reconstruction.has_geotagged_photos(): + image_groups_file = os.path.join(args.project_path, "image_groups.txt") + if 'split_image_groups_is_set' in args: + image_groups_file = os.path.abspath(args.split_image_groups) + + if io.file_exists(image_groups_file): + outputs['large'] = True + elif len(photos) > args.split: + # check for availability of geotagged photos + if reconstruction.has_geotagged_photos(): outputs['large'] = True else: log.ODM_WARNING('Could not perform split-merge as GPS information in photos or image_groups.txt is missing.')