From 25f19dc49c621164c88fe841e32781e3e996010f Mon Sep 17 00:00:00 2001 From: Piero Toffanin Date: Wed, 24 Apr 2019 20:01:44 -0400 Subject: [PATCH] image_groups.txt file support Former-commit-id: 7210e99e3ace8d343b43de28c3b0c9b631ec5e97 --- Dockerfile | 2 +- configure.sh | 2 +- opendm/osfm.py | 10 +++++++++- portable.Dockerfile | 2 +- scripts/odm_app.py | 2 +- scripts/splitmerge.py | 5 +++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 276ddf0d..eb289250 100644 --- a/Dockerfile +++ b/Dockerfile @@ -69,7 +69,7 @@ RUN pip install -U \ numpy==1.15.4 \ psutil \ pyproj \ - PyYAML \ + PyYAML==3.13 \ repoze.lru \ scipy \ shapely \ diff --git a/configure.sh b/configure.sh index 506d77ba..1ef58c02 100755 --- a/configure.sh +++ b/configure.sh @@ -71,7 +71,7 @@ install() { libboost-thread-dev \ python-pyproj - pip install -U PyYAML \ + pip install -U PyYAML==3.13 \ exifread \ gpxpy \ xmltodict \ diff --git a/opendm/osfm.py b/opendm/osfm.py index 07843605..763378c9 100644 --- a/opendm/osfm.py +++ b/opendm/osfm.py @@ -57,9 +57,10 @@ def setup(args, images_path, opensfm_path, photos, gcp_path=None, append_config if not io.dir_exists(opensfm_path): system.mkdir_p(opensfm_path) - # create file list list_path = io.join_paths(opensfm_path, 'image_list.txt') if not io.file_exists(list_path) or rerun: + + # create file list has_alt = True with open(list_path, 'w') as fout: for photo in photos: @@ -111,9 +112,16 @@ def setup(args, images_path, opensfm_path, photos, gcp_path=None, append_config config_filename = io.join_paths(opensfm_path, 'config.yaml') with open(config_filename, 'w') as fout: fout.write("\n".join(config)) + + # check for image_groups.txt (split-merge) + image_groups_file = os.path.join(args.project_path, "image_groups.txt") + if io.file_exists(image_groups_file): + log.ODM_DEBUG("Copied image_groups.txt to OpenSfM directory") + io.copy(image_groups_file, os.path.join(opensfm_path, "image_groups.txt")) else: log.ODM_WARNING("%s already exists, not rerunning OpenSfM setup" % list_path) + def feature_matching(opensfm_project_path, rerun=False): if not feature_matching_done(opensfm_project_path) or rerun: run('extract_metadata', opensfm_project_path) diff --git a/portable.Dockerfile b/portable.Dockerfile index 87cf03f9..c06627bd 100644 --- a/portable.Dockerfile +++ b/portable.Dockerfile @@ -69,7 +69,7 @@ RUN pip install -U \ numpy==1.15.4 \ psutil \ pyproj \ - PyYAML \ + PyYAML==3.13 \ repoze.lru \ scipy \ shapely \ diff --git a/scripts/odm_app.py b/scripts/odm_app.py index 3f3bcae0..e3526f6f 100644 --- a/scripts/odm_app.py +++ b/scripts/odm_app.py @@ -65,7 +65,7 @@ class ODMApp: build_overviews=args.build_overviews, max_concurrency=args.max_concurrency, verbose=args.verbose) - + if not args.video: # Normal pipeline self.first_stage = dataset diff --git a/scripts/splitmerge.py b/scripts/splitmerge.py index c2c17893..85604fda 100644 --- a/scripts/splitmerge.py +++ b/scripts/splitmerge.py @@ -1,4 +1,5 @@ -import os, sys +import os +import shutil from opendm import log from opendm import osfm from opendm import types @@ -43,7 +44,7 @@ class ODMSplitStage(types.ODM_Stage): osfm.run("create_submodels", tree.opensfm) else: log.ODM_WARNING("Submodels directory already exist at: %s" % tree.submodels_path) - + # TODO: on a network workflow we probably stop here # and let NodeODM take over # exit(0)