kopia lustrzana https://github.com/OpenDroneMap/ODM
Add --rerun-from functionality
rodzic
dee63447df
commit
6bf072dfaa
|
@ -6,6 +6,12 @@ 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):
|
||||
print processopts[processopts.index(values):]
|
||||
setattr(namespace, self.dest, processopts[processopts.index(values):])
|
||||
|
||||
|
||||
parser = argparse.ArgumentParser(description='OpenDroneMap')
|
||||
parser.add_argument('--project-path',
|
||||
metavar='<string>',
|
||||
|
@ -42,6 +48,7 @@ rerun.add_argument('--rerun-all',
|
|||
help='force rerun of all tasks')
|
||||
|
||||
rerun.add_argument('--rerun-from',
|
||||
action=RerunFrom,
|
||||
metavar='<string>',
|
||||
choices=processopts,
|
||||
help=('Can be one of:' + ' | '.join(processopts)))
|
||||
|
|
|
@ -30,7 +30,9 @@ class ODMCmvsCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'cmvs') or \
|
||||
args['rerun_all']
|
||||
(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)
|
||||
|
|
|
@ -65,7 +65,9 @@ class ODMGeoreferencingCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'odm_georeferencing') or \
|
||||
args['rerun_all']
|
||||
(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:
|
||||
|
|
|
@ -40,7 +40,9 @@ class ODMeshingCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'odm_meshing') or \
|
||||
args['rerun_all']
|
||||
(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)
|
||||
|
|
|
@ -30,7 +30,9 @@ class ODMOrthoPhotoCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'odm_orthophoto') or \
|
||||
args['rerun_all']
|
||||
(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:
|
||||
|
||||
|
|
|
@ -34,7 +34,9 @@ class ODMTexturingCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'odm_texturing') or \
|
||||
args['rerun_all']
|
||||
(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' \
|
||||
|
|
|
@ -40,7 +40,9 @@ class ODMOpenSfMCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'opensfm') or \
|
||||
args['rerun_all']
|
||||
(args['rerun_all']) or \
|
||||
(args['rerun_from'] is not None and
|
||||
'opensfm' in args['rerun_from'])
|
||||
|
||||
|
||||
### check if reconstruction was done before
|
||||
|
|
|
@ -43,7 +43,9 @@ class ODMPmvsCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'pmvs') or \
|
||||
args['rerun_all']
|
||||
(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)
|
||||
|
|
|
@ -38,7 +38,9 @@ class ODMResizeCell(ecto.Cell):
|
|||
# check if we rerun cell or not
|
||||
rerun_cell = (args['rerun'] is not None and
|
||||
args['rerun'] == 'resize') or \
|
||||
args['rerun_all']
|
||||
(args['rerun_all']) or \
|
||||
(args['rerun_from'] is not None and
|
||||
'resize' in args['rerun_from'])
|
||||
|
||||
# loop over photos
|
||||
for photo in photos:
|
||||
|
|
Ładowanie…
Reference in New Issue