kopia lustrzana https://github.com/OpenDroneMap/ODM
Adapt to the removed resize step
rodzic
4bacaf5c7c
commit
2e59dfab6b
|
@ -8,7 +8,7 @@ from appsettings import SettingsParser
|
|||
import sys
|
||||
|
||||
# parse arguments
|
||||
processopts = ['resize', 'opensfm', 'slam', 'cmvs', 'pmvs',
|
||||
processopts = ['dataset', 'opensfm', 'slam', 'cmvs', 'pmvs',
|
||||
'odm_meshing', 'odm_25dmeshing', 'mvs_texturing', 'odm_georeferencing',
|
||||
'odm_dem', 'odm_orthophoto']
|
||||
|
||||
|
@ -143,7 +143,7 @@ def config():
|
|||
type=int,
|
||||
help=('The maximum number of processes to use in dense '
|
||||
'reconstruction. Default: %(default)s'))
|
||||
|
||||
|
||||
parser.add_argument('--use-25dmesh',
|
||||
action='store_true',
|
||||
default=False,
|
||||
|
@ -242,7 +242,7 @@ def config():
|
|||
'Increasing this value increases computation '
|
||||
'times slightly but helps reduce memory usage. '
|
||||
'Default: %(default)s'))
|
||||
|
||||
|
||||
parser.add_argument('--mesh-remove-outliers',
|
||||
metavar='<percent>',
|
||||
default=2,
|
||||
|
@ -271,8 +271,8 @@ def config():
|
|||
metavar='<string>',
|
||||
default='gauss_clamping',
|
||||
choices=['none', 'gauss_clamping', 'gauss_damping'],
|
||||
help=('Type of photometric outlier removal method: '
|
||||
'[none, gauss_damping, gauss_clamping]. Default: '
|
||||
help=('Type of photometric outlier removal method: '
|
||||
'[none, gauss_damping, gauss_clamping]. Default: '
|
||||
'%(default)s'))
|
||||
|
||||
parser.add_argument('--texturing-skip-visibility-test',
|
||||
|
@ -301,7 +301,7 @@ def config():
|
|||
parser.add_argument('--texturing-keep-unseen-faces',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help=('Keep faces in the mesh that are not seen in any camera. '
|
||||
help=('Keep faces in the mesh that are not seen in any camera. '
|
||||
'Default: %(default)s'))
|
||||
|
||||
parser.add_argument('--texturing-tone-mapping',
|
||||
|
@ -332,7 +332,7 @@ def config():
|
|||
default=False,
|
||||
help='Use this tag to build a DTM (Digital Terrain Model, ground only) using a progressive '
|
||||
'morphological filter. Check the --dem* parameters for fine tuning.')
|
||||
|
||||
|
||||
parser.add_argument('--dsm',
|
||||
action='store_true',
|
||||
default=False,
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
import os
|
||||
import ecto
|
||||
|
||||
from functools import partial
|
||||
from multiprocessing import Pool
|
||||
from opendm import context
|
||||
from opendm import io
|
||||
from opendm import types
|
||||
|
@ -27,6 +25,7 @@ class ODMLoadDatasetCell(ecto.Cell):
|
|||
|
||||
def declare_io(self, params, inputs, outputs):
|
||||
inputs.declare("tree", "Struct with paths", [])
|
||||
inputs.declare("args", "The application arguments.", {})
|
||||
outputs.declare("photos", "list of ODMPhotos", [])
|
||||
|
||||
def process(self, inputs, outputs):
|
||||
|
@ -45,6 +44,7 @@ class ODMLoadDatasetCell(ecto.Cell):
|
|||
|
||||
# get inputs
|
||||
tree = self.inputs.tree
|
||||
args = self.inputs.args
|
||||
|
||||
# get images directory
|
||||
input_dir = tree.input_images
|
||||
|
@ -70,8 +70,8 @@ class ODMLoadDatasetCell(ecto.Cell):
|
|||
photos = []
|
||||
for files in path_files:
|
||||
photos += [make_odm_photo(self.params.force_focal, self.params.force_ccd, files)]
|
||||
|
||||
log.ODM_INFO('Found %s usable images' % len(photos))
|
||||
|
||||
log.ODM_INFO('Found %s usable images' % len(photos))
|
||||
else:
|
||||
log.ODM_ERROR('Not enough supported images in %s' % images_dir)
|
||||
return ecto.QUIT
|
||||
|
@ -80,4 +80,4 @@ class ODMLoadDatasetCell(ecto.Cell):
|
|||
outputs.photos = photos
|
||||
|
||||
log.ODM_INFO('Running ODM Load Dataset Cell - Finished')
|
||||
return ecto.OK
|
||||
return ecto.OK if args.end_with != 'dataset' else ecto.QUIT
|
||||
|
|
|
@ -27,13 +27,13 @@ def run_command(args):
|
|||
|
||||
def resize_images(data_path, args):
|
||||
command = os.path.join(context.root_path, 'run.py')
|
||||
path, name = os.path.split(data_path)
|
||||
path, name = os.path.split(data_path.rstrip('/'))
|
||||
run_command(['python',
|
||||
command,
|
||||
'--project-path', path,
|
||||
name,
|
||||
'--resize-to', str(args.resize_to),
|
||||
'--end-with', 'resize',
|
||||
'--end-with', 'dataset',
|
||||
])
|
||||
|
||||
|
||||
|
@ -58,7 +58,7 @@ def create_config(opensfm_path, args):
|
|||
config = {
|
||||
"submodels_relpath": "../submodels/opensfm",
|
||||
"submodel_relpath_template": "../submodels/submodel_%04d/opensfm",
|
||||
"submodel_images_relpath_template": "../submodels/submodel_%04d/images_resize",
|
||||
"submodel_images_relpath_template": "../submodels/submodel_%04d/images",
|
||||
|
||||
"feature_process_size": args.resize_to,
|
||||
"feature_min_frames": args.min_num_features,
|
||||
|
@ -118,7 +118,7 @@ if __name__ == '__main__':
|
|||
|
||||
resize_images(data_path, args)
|
||||
|
||||
image_path = os.path.join(data_path, 'images_resize')
|
||||
image_path = os.path.join(data_path, 'images')
|
||||
opensfm_path = os.path.join(data_path, 'opensfm')
|
||||
|
||||
mkdir_p(opensfm_path)
|
||||
|
|
|
@ -107,7 +107,8 @@ class ODMApp(ecto.BlackBox):
|
|||
# define the connections like you would for the plasm
|
||||
|
||||
# load the dataset
|
||||
connections = [self.tree[:] >> self.dataset['tree']]
|
||||
connections = [self.tree[:] >> self.dataset['tree'],
|
||||
self.args[:] >> self.dataset['args']]
|
||||
|
||||
# run opensfm with images from load dataset
|
||||
connections += [self.tree[:] >> self.opensfm['tree'],
|
||||
|
@ -134,7 +135,7 @@ class ODMApp(ecto.BlackBox):
|
|||
connections += [self.tree[:] >> self.meshing['tree'],
|
||||
self.args[:] >> self.meshing['args'],
|
||||
self.pmvs['reconstruction'] >> self.meshing['reconstruction']]
|
||||
|
||||
|
||||
# create odm texture
|
||||
connections += [self.tree[:] >> self.texturing['tree'],
|
||||
self.args[:] >> self.texturing['args'],
|
||||
|
@ -145,12 +146,12 @@ class ODMApp(ecto.BlackBox):
|
|||
self.args[:] >> self.georeferencing['args'],
|
||||
self.dataset['photos'] >> self.georeferencing['photos'],
|
||||
self.texturing['reconstruction'] >> self.georeferencing['reconstruction']]
|
||||
|
||||
|
||||
# create odm dem
|
||||
connections += [self.tree[:] >> self.dem['tree'],
|
||||
self.args[:] >> self.dem['args'],
|
||||
self.georeferencing['reconstruction'] >> self.dem['reconstruction']]
|
||||
|
||||
|
||||
# create odm orthophoto
|
||||
connections += [self.tree[:] >> self.orthophoto['tree'],
|
||||
self.args[:] >> self.orthophoto['args'],
|
||||
|
|
Ładowanie…
Reference in New Issue