Add settings.yaml file for default options

pull/510/head
Dakota Benjamin 2017-02-09 12:55:45 -05:00
rodzic 5b0cd53f2e
commit c193a29656
2 zmienionych plików z 16 dodań i 4 usunięć

Wyświetl plik

@ -1,11 +1,16 @@
import argparse
import context
from opendm import context
# parse arguments
processopts = ['resize', 'opensfm', 'slam', 'cmvs', 'pmvs',
'odm_meshing', 'mvs_texturing', 'odm_georeferencing',
'odm_orthophoto']
# Load global settings file
with open(context.settings_path) as stream:
datamap = yaml.safe_load(stream)
defaultSettings = datamap['settings']
class RerunFrom(argparse.Action):
def __call__(self, parser, namespace, values, option_string=None):
@ -22,7 +27,8 @@ def config():
parser.add_argument('--project-path',
metavar='<string>',
help='Path to the project to process')
help='Path to the project to process',
default=defaultSettings[0]['project_path'])
parser.add_argument('--resize-to', # currently doesn't support 'orig'
metavar='<integer>',
@ -124,14 +130,14 @@ def config():
parser.add_argument('--opensfm-processes',
metavar='<positive integer>',
default=context.num_cores,
default=defaultSettings[2]['opensfm_processes'],
type=int,
help=('The maximum number of processes to use in dense '
'reconstruction. Default: %(default)s'))
parser.add_argument('--use-opensfm-pointcloud',
action='store_true',
default=False,
default=defaultSettings[1]['opensfm_pointcloud'],
help='Use OpenSfM to compute the point cloud instead '
'of PMVS')

Wyświetl plik

@ -1,5 +1,6 @@
import os
import sys
from opendm import io
import multiprocessing
# Define some needed locations
@ -37,6 +38,11 @@ pdal_path = os.path.join(superbuild_path, 'build/pdal/bin')
odm_modules_path = os.path.join(root_path, "build/bin")
odm_modules_src_path = os.path.join(root_path, "modules")
settings_path = os.path.join(root_path, 'settings.yaml')
if not io.file_exists(settings_path):
settings_path = os.path.join(root_path, 'default.settings.yaml')
# Define supported image extensions
supported_extensions = {'.jpg','.jpeg','.png'}