kopia lustrzana https://github.com/OpenDroneMap/ODM
Don't show rasterio log warns on init, sm-cluster config
Former-commit-id: 0f087f46d7
pull/1161/head
rodzic
91db2cc2dd
commit
3ef7a3a8bd
|
@ -22,6 +22,20 @@ def alphanumeric_string(string):
|
||||||
raise argparse.ArgumentTypeError(msg)
|
raise argparse.ArgumentTypeError(msg)
|
||||||
return string
|
return string
|
||||||
|
|
||||||
|
# Django URL validation regex
|
||||||
|
def url_string(string):
|
||||||
|
import re
|
||||||
|
regex = re.compile(
|
||||||
|
r'^(?:http|ftp)s?://' # http:// or https://
|
||||||
|
r'(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|' #domain...
|
||||||
|
r'localhost|' #localhost...
|
||||||
|
r'\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})' # ...or ip
|
||||||
|
r'(?::\d+)?' # optional port
|
||||||
|
r'(?:/?|[/?]\S+)$', re.IGNORECASE)
|
||||||
|
|
||||||
|
if re.match(regex, string) is None:
|
||||||
|
raise argparse.ArgumentTypeError("%s is not a valid URL. The URL must be in the format: http(s)://host[:port]/[?token=]" % string)
|
||||||
|
return string
|
||||||
|
|
||||||
class RerunFrom(argparse.Action):
|
class RerunFrom(argparse.Action):
|
||||||
def __call__(self, parser, namespace, values, option_string=None):
|
def __call__(self, parser, namespace, values, option_string=None):
|
||||||
|
@ -517,13 +531,14 @@ def config():
|
||||||
'are added to the cluster. This is done to ensure '
|
'are added to the cluster. This is done to ensure '
|
||||||
'that neighboring submodels overlap.')
|
'that neighboring submodels overlap.')
|
||||||
|
|
||||||
parser.add_argument('--split-distributed',
|
parser.add_argument('--sm-cluster',
|
||||||
action='store_true',
|
metavar='<string>',
|
||||||
default=False,
|
type=url_string,
|
||||||
help='Optimizes the split-merge workflow for a distributed computing environment. '
|
default=None,
|
||||||
'When this is turned on, feature detection and matching on images is '
|
help='URL to a nodeodm-proxy instance '
|
||||||
'performed independently on the submodels instead of being computed at once. '
|
'for distributing a split-merge workflow on '
|
||||||
'Default: %(default)s')
|
'multiple nodes in parallel. '
|
||||||
|
'Default: %(default)s')
|
||||||
|
|
||||||
parser.add_argument('--merge',
|
parser.add_argument('--merge',
|
||||||
metavar='<string>',
|
metavar='<string>',
|
||||||
|
|
|
@ -7,15 +7,15 @@ WARNING = '\033[93m'
|
||||||
FAIL = '\033[91m'
|
FAIL = '\033[91m'
|
||||||
ENDC = '\033[0m'
|
ENDC = '\033[0m'
|
||||||
|
|
||||||
# TODO add file handling
|
def init():
|
||||||
|
# TODO add file handling
|
||||||
|
logging.addLevelName(logging.INFO, '%s[%s]' % (OKBLUE, logging.getLevelName(logging.INFO)))
|
||||||
|
logging.addLevelName(logging.WARNING, '%s[%s]' % (WARNING, logging.getLevelName(logging.WARNING)))
|
||||||
|
logging.addLevelName(logging.ERROR, '%s[%s]' % (FAIL, logging.getLevelName(logging.ERROR)))
|
||||||
|
logging.addLevelName(logging.DEBUG, '%s[%s]' % (OKGREEN, logging.getLevelName(logging.DEBUG)))
|
||||||
|
|
||||||
logging.addLevelName(logging.INFO, '%s[%s]' % (OKBLUE, logging.getLevelName(logging.INFO)))
|
logging.basicConfig(level=logging.DEBUG,
|
||||||
logging.addLevelName(logging.WARNING, '%s[%s]' % (WARNING, logging.getLevelName(logging.WARNING)))
|
format='%(levelname)-14s %(message)s' + ENDC)
|
||||||
logging.addLevelName(logging.ERROR, '%s[%s]' % (FAIL, logging.getLevelName(logging.ERROR)))
|
|
||||||
logging.addLevelName(logging.DEBUG, '%s[%s]' % (OKGREEN, logging.getLevelName(logging.DEBUG)))
|
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG,
|
|
||||||
format='%(levelname)-14s %(message)s' + ENDC)
|
|
||||||
|
|
||||||
|
|
||||||
ODM_INFO = logging.info
|
ODM_INFO = logging.info
|
||||||
|
|
2
run.py
2
run.py
|
@ -11,7 +11,7 @@ from pipes import quote
|
||||||
from scripts.odm_app import ODMApp
|
from scripts.odm_app import ODMApp
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
log.init()
|
||||||
args = config.config()
|
args = config.config()
|
||||||
|
|
||||||
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
|
log.ODM_INFO('Initializing OpenDroneMap app - %s' % system.now())
|
||||||
|
|
Ładowanie…
Reference in New Issue