kopia lustrzana https://github.com/OpenDroneMap/ODM
commit
65a5e42ac4
|
@ -6,6 +6,11 @@ processopts = ['resize', 'opensfm', 'cmvs', 'pmvs',
|
||||||
'odm_meshing', 'odm_texturing', 'odm_georeferencing',
|
'odm_meshing', 'odm_texturing', 'odm_georeferencing',
|
||||||
'odm_orthophoto']
|
'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 = argparse.ArgumentParser(description='OpenDroneMap')
|
||||||
parser.add_argument('--project-path',
|
parser.add_argument('--project-path',
|
||||||
metavar='<string>',
|
metavar='<string>',
|
||||||
|
@ -29,10 +34,23 @@ parser.add_argument('--end-with', '-e',
|
||||||
choices=processopts,
|
choices=processopts,
|
||||||
help=('Can be one of:' + ' | '.join(processopts)))
|
help=('Can be one of:' + ' | '.join(processopts)))
|
||||||
|
|
||||||
parser.add_argument('--rerun', '-r',
|
rerun = parser.add_mutually_exclusive_group()
|
||||||
metavar='<string>',
|
|
||||||
choices=processopts,
|
rerun.add_argument('--rerun', '-r',
|
||||||
help=('Can be one of:' + ' | '.join(processopts)))
|
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',
|
parser.add_argument('--force-focal',
|
||||||
metavar='<positive float>',
|
metavar='<positive float>',
|
||||||
|
@ -59,7 +77,7 @@ parser.add_argument('--matcher-threshold',
|
||||||
type=float,
|
type=float,
|
||||||
help=('Ignore matched keypoints if the two images share '
|
help=('Ignore matched keypoints if the two images share '
|
||||||
'less than <float> percent of keypoints. Default:'
|
'less than <float> percent of keypoints. Default:'
|
||||||
' $(default)s'))
|
' $(default)s'))
|
||||||
|
|
||||||
parser.add_argument('--matcher-ratio',
|
parser.add_argument('--matcher-ratio',
|
||||||
metavar='<float>',
|
metavar='<float>',
|
||||||
|
|
|
@ -28,8 +28,11 @@ class ODMCmvsCell(ecto.Cell):
|
||||||
tree = self.inputs.tree
|
tree = self.inputs.tree
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'cmvs'
|
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:
|
if not io.file_exists(tree.pmvs_bundle) or rerun_cell:
|
||||||
log.ODM_DEBUG('Writting CMVS vis in: %s' % tree.pmvs_bundle)
|
log.ODM_DEBUG('Writting CMVS vis in: %s' % tree.pmvs_bundle)
|
||||||
|
|
|
@ -63,8 +63,11 @@ class ODMGeoreferencingCell(ecto.Cell):
|
||||||
return ecto.QUIT
|
return ecto.QUIT
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'odm_georeferencing'
|
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 \
|
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:
|
not io.file_exists(tree.odm_textured_model_ply_geo) or rerun_cell:
|
||||||
|
|
|
@ -38,8 +38,11 @@ class ODMeshingCell(ecto.Cell):
|
||||||
system.mkdir_p(tree.odm_meshing)
|
system.mkdir_p(tree.odm_meshing)
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'odm_meshing'
|
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:
|
if not io.file_exists(tree.odm_mesh) or rerun_cell:
|
||||||
log.ODM_DEBUG('Writting ODM Mesh file in: %s' % tree.odm_mesh)
|
log.ODM_DEBUG('Writting ODM Mesh file in: %s' % tree.odm_mesh)
|
||||||
|
|
|
@ -28,8 +28,11 @@ class ODMOrthoPhotoCell(ecto.Cell):
|
||||||
system.mkdir_p(tree.odm_orthophoto)
|
system.mkdir_p(tree.odm_orthophoto)
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'odm_orthophoto'
|
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:
|
if not io.file_exists(tree.odm_orthophoto_file) or rerun_cell:
|
||||||
|
|
||||||
|
|
|
@ -32,8 +32,11 @@ class ODMTexturingCell(ecto.Cell):
|
||||||
system.mkdir_p(tree.odm_texturing)
|
system.mkdir_p(tree.odm_texturing)
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'odm_texturing'
|
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:
|
if not io.file_exists(tree.odm_textured_model_obj) or rerun_cell:
|
||||||
log.ODM_DEBUG('Writting ODM Textured file in: %s' \
|
log.ODM_DEBUG('Writting ODM Textured file in: %s' \
|
||||||
|
|
|
@ -38,8 +38,11 @@ class ODMOpenSfMCell(ecto.Cell):
|
||||||
system.mkdir_p(tree.pmvs)
|
system.mkdir_p(tree.pmvs)
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'opensfm'
|
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
|
### check if reconstruction was done before
|
||||||
|
|
|
@ -41,8 +41,11 @@ class ODMPmvsCell(ecto.Cell):
|
||||||
tree = self.inputs.tree
|
tree = self.inputs.tree
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'pmvs'
|
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:
|
if not io.file_exists(tree.pmvs_model) or rerun_cell:
|
||||||
log.ODM_DEBUG('Creating dense pointcloud in: %s' % tree.pmvs_model)
|
log.ODM_DEBUG('Creating dense pointcloud in: %s' % tree.pmvs_model)
|
||||||
|
|
|
@ -36,8 +36,11 @@ class ODMResizeCell(ecto.Cell):
|
||||||
log.ODM_DEBUG('Resizing dataset to: %s' % tree.dataset_resize)
|
log.ODM_DEBUG('Resizing dataset to: %s' % tree.dataset_resize)
|
||||||
|
|
||||||
# check if we rerun cell or not
|
# check if we rerun cell or not
|
||||||
rerun_cell = args['rerun'] is not None \
|
rerun_cell = (args['rerun'] is not None and
|
||||||
and args['rerun'] == 'resize'
|
args['rerun'] == 'resize') or \
|
||||||
|
(args['rerun_all']) or \
|
||||||
|
(args['rerun_from'] is not None and
|
||||||
|
'resize' in args['rerun_from'])
|
||||||
|
|
||||||
# loop over photos
|
# loop over photos
|
||||||
for photo in photos:
|
for photo in photos:
|
||||||
|
|
Ładowanie…
Reference in New Issue