Merge branch 'master' into gltf

pull/1587/head
Piero Toffanin 2022-10-19 12:12:22 -04:00
commit ff31f9b0dd
7 zmienionych plików z 45 dodań i 38 usunięć

Wyświetl plik

@ -53,7 +53,7 @@ ExternalProject_Add(${_proj_name}
#--Download step--------------
DOWNLOAD_DIR ${SB_DOWNLOAD_DIR}
GIT_REPOSITORY https://github.com/OpenDroneMap/openMVS
GIT_TAG 291
GIT_TAG 292
#--Update/Patch step----------
UPDATE_COMMAND ""
#--Configure step-------------

Wyświetl plik

@ -1 +1 @@
2.9.1
2.9.2

Wyświetl plik

@ -731,11 +731,12 @@ def config(argv=None, parser=None):
'The file needs to use the following format: \n'
'image_name group_name\n'
'Default: %(default)s'))
# parser.add_argument('--split-multitracks',
# action=StoreTrue,
# nargs=0,
# default=False,
# help='Split multi-track reconstructions.')
parser.add_argument('--sm-no-align',
action=StoreTrue,
nargs=0,
default=False,
help='Skip alignment of submodels in split-merge. Useful if GPS is good enough on very large datasets. Default: %(default)s')
parser.add_argument('--sm-cluster',
metavar='<string>',

Wyświetl plik

@ -197,7 +197,8 @@ apps:
environment:
# Ensure libraries are found
LD_LIBRARY_PATH: $SNAP/odm/SuperBuild/install/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack
PYTHONPATH: $SNAP/odm/SuperBuild/install/lib/python3.8/dist-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages/:$SNAP/usr/lib/python3.8:$SNAP/odm/SuperBuild/install/bin/opensfm
PYTHONPATH: $SNAP/odm/SuperBuild/install/lib/python3.8/site-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages/:$SNAP/usr/lib/python3.8:$SNAP/odm/SuperBuild/install/bin/opensfm
PROJ_LIB: $SNAP/usr/share/proj
plugs:
- home
- network

Wyświetl plik

@ -199,7 +199,8 @@ apps:
environment:
# Ensure libraries are found
LD_LIBRARY_PATH: $SNAP/odm/SuperBuild/install/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/blas:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/lapack
PYTHONPATH: $SNAP/odm/SuperBuild/install/lib/python3.8/dist-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages/:$SNAP/usr/lib/python3.8:$SNAP/odm/SuperBuild/install/bin/opensfm
PYTHONPATH: $SNAP/odm/SuperBuild/install/lib/python3.8/site-packages:$SNAP/lib/python3.8/site-packages:$SNAP/usr/lib/python3/dist-packages/:$SNAP/usr/lib/python3.8:$SNAP/odm/SuperBuild/install/bin/opensfm
PROJ_LIB: $SNAP/usr/share/proj
plugs:
- home
- network

Wyświetl plik

@ -75,8 +75,10 @@ class ODMOpenMVSStage(types.ODM_Stage):
]
gpu_config = []
if not has_gpu(args):
use_gpu = has_gpu(args)
if use_gpu:
gpu_config.append("--cuda-device -3")
else:
gpu_config.append("--cuda-device -2")
if args.pc_tile:
@ -106,9 +108,9 @@ class ODMOpenMVSStage(types.ODM_Stage):
except system.SubprocessException as e:
# If the GPU was enabled and the program failed,
# try to run it again without GPU
if e.errorCode == 1 and len(gpu_config) == 0:
if e.errorCode == 1 and use_gpu:
log.ODM_WARNING("OpenMVS failed with GPU, is your graphics card driver up to date? Falling back to CPU.")
gpu_config.append("--cuda-device -2")
gpu_config = ["--cuda-device -2"]
run_densify()
else:
raise e

Wyświetl plik

@ -124,37 +124,39 @@ class ODMSplitStage(types.ODM_Stage):
self.update_progress(50)
# Align
octx.align_reconstructions(self.rerun())
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)
aligned_recon = sp_octx.path('reconstruction.aligned.json')
unaligned_recon = sp_octx.path('reconstruction.unaligned.json')
main_recon = sp_octx.path('reconstruction.json')
# Align
if not args.sm_no_align:
octx.align_reconstructions(self.rerun())
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
self.update_progress(55)
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
# Aligned reconstruction is in reconstruction.aligned.json
# We need to rename it to reconstruction.json
for sp in submodel_paths:
sp_octx = OSFMContext(sp)
if io.file_exists(main_recon):
shutil.move(main_recon, unaligned_recon)
aligned_recon = sp_octx.path('reconstruction.aligned.json')
unaligned_recon = sp_octx.path('reconstruction.unaligned.json')
main_recon = sp_octx.path('reconstruction.json')
shutil.move(aligned_recon, main_recon)
log.ODM_INFO("%s is now %s" % (aligned_recon, main_recon))
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 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))
# Remove invalid submodels
submodel_paths = [p for p in submodel_paths if not p in remove_paths]