Adapt to the removed resize step

pull/753/head
Pau Gargallo 2017-09-29 13:57:34 +02:00 zatwierdzone przez Dakota Benjamin
rodzic 4bacaf5c7c
commit 2e59dfab6b
4 zmienionych plików z 21 dodań i 20 usunięć

Wyświetl plik

@ -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']

Wyświetl plik

@ -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
@ -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

Wyświetl plik

@ -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)

Wyświetl plik

@ -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'],