Merge pull request #259 from dakotabenjamin/run-from-all

--rerun-from, --rerun-all
pull/261/head
Dakota Benjamin 2016-02-25 13:49:52 -05:00
commit 65a5e42ac4
9 zmienionych plików z 63 dodań i 21 usunięć

Wyświetl plik

@ -6,6 +6,11 @@ processopts = ['resize', 'opensfm', 'cmvs', 'pmvs',
'odm_meshing', 'odm_texturing', 'odm_georeferencing',
'odm_orthophoto']
class RerunFrom(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None)
setattr(namespace, self.dest, processopts[processopts.index(values):])
parser = argparse.ArgumentParser(description='OpenDroneMap')
parser.add_argument('--project-path',
metavar='<string>',
@ -29,10 +34,23 @@ parser.add_argument('--end-with', '-e',
choices=processopts,
help=('Can be one of:' + ' | '.join(processopts)))
parser.add_argument('--rerun', '-r',
metavar='<string>',
choices=processopts,
help=('Can be one of:' + ' | '.join(processopts)))
rerun = parser.add_mutually_exclusive_group()
rerun.add_argument('--rerun', '-r',
metavar='<string>',
choices=processopts,
help=('Can be one of:' + ' | '.join(processopts)))
rerun.add_argument('--rerun-all',
action='store_true',
default=False,
help='force rerun of all tasks')
rerun.add_argument('--rerun-from',
action=RerunFrom,
metavar='<string>',
choices=processopts,
help=('Can be one of:' + ' | '.join(processopts)))
parser.add_argument('--force-focal',
metavar='<positive float>',
@ -59,7 +77,7 @@ parser.add_argument('--matcher-threshold',
type=float,
help=('Ignore matched keypoints if the two images share '
'less than <float> percent of keypoints. Default:'
' $(default)s'))
' $(default)s'))
parser.add_argument('--matcher-ratio',
metavar='<float>',

Wyświetl plik

@ -28,8 +28,11 @@ class ODMCmvsCell(ecto.Cell):
tree = self.inputs.tree
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'cmvs'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'cmvs') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'cmvs' in args['rerun_from'])
if not io.file_exists(tree.pmvs_bundle) or rerun_cell:
log.ODM_DEBUG('Writting CMVS vis in: %s' % tree.pmvs_bundle)

Wyświetl plik

@ -63,8 +63,11 @@ class ODMGeoreferencingCell(ecto.Cell):
return ecto.QUIT
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'odm_georeferencing'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'odm_georeferencing') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'odm_georeferencing' in args['rerun_from'])
if not io.file_exists(tree.odm_textured_model_obj_geo) or \
not io.file_exists(tree.odm_textured_model_ply_geo) or rerun_cell:

Wyświetl plik

@ -38,8 +38,11 @@ class ODMeshingCell(ecto.Cell):
system.mkdir_p(tree.odm_meshing)
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'odm_meshing'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'odm_meshing') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'odm_meshing' in args['rerun_from'])
if not io.file_exists(tree.odm_mesh) or rerun_cell:
log.ODM_DEBUG('Writting ODM Mesh file in: %s' % tree.odm_mesh)

Wyświetl plik

@ -28,8 +28,11 @@ class ODMOrthoPhotoCell(ecto.Cell):
system.mkdir_p(tree.odm_orthophoto)
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'odm_orthophoto'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'odm_orthophoto') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'odm_orthophoto' in args['rerun_from'])
if not io.file_exists(tree.odm_orthophoto_file) or rerun_cell:

Wyświetl plik

@ -32,8 +32,11 @@ class ODMTexturingCell(ecto.Cell):
system.mkdir_p(tree.odm_texturing)
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'odm_texturing'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'odm_texturing') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'odm_texturing' in args['rerun_from'])
if not io.file_exists(tree.odm_textured_model_obj) or rerun_cell:
log.ODM_DEBUG('Writting ODM Textured file in: %s' \

Wyświetl plik

@ -38,8 +38,11 @@ class ODMOpenSfMCell(ecto.Cell):
system.mkdir_p(tree.pmvs)
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'opensfm'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'opensfm') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'opensfm' in args['rerun_from'])
### check if reconstruction was done before

Wyświetl plik

@ -41,8 +41,11 @@ class ODMPmvsCell(ecto.Cell):
tree = self.inputs.tree
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'pmvs'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'pmvs') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'pmvs' in args['rerun_from'])
if not io.file_exists(tree.pmvs_model) or rerun_cell:
log.ODM_DEBUG('Creating dense pointcloud in: %s' % tree.pmvs_model)

Wyświetl plik

@ -36,8 +36,11 @@ class ODMResizeCell(ecto.Cell):
log.ODM_DEBUG('Resizing dataset to: %s' % tree.dataset_resize)
# check if we rerun cell or not
rerun_cell = args['rerun'] is not None \
and args['rerun'] == 'resize'
rerun_cell = (args['rerun'] is not None and
args['rerun'] == 'resize') or \
(args['rerun_all']) or \
(args['rerun_from'] is not None and
'resize' in args['rerun_from'])
# loop over photos
for photo in photos: