diff --git a/bin/meshroom_batch b/bin/meshroom_batch index 0ba1e508..5e141495 100755 --- a/bin/meshroom_batch +++ b/bin/meshroom_batch @@ -9,6 +9,7 @@ meshroom.setupEnvironment() import meshroom.core.graph from meshroom import multiview +import logging parser = argparse.ArgumentParser(description='Launch the full photogrammetry or Panorama HDR pipeline.') parser.add_argument('-i', '--input', metavar='SFM/FOLDERS/IMAGES', type=str, nargs='*', @@ -66,9 +67,24 @@ parser.add_argument('--submitter', default='SimpleFarm', help='Execute job with a specific submitter.') +parser.add_argument('-v', '--verbose', help="Verbosity level", default='', + choices=['', 'fatal', 'error', 'warning', 'info', 'debug', 'trace'],) + args = parser.parse_args() +logStringToPython = { + 'fatal': logging.FATAL, + 'error': logging.ERROR, + 'warning': logging.WARNING, + 'info': logging.INFO, + 'debug': logging.DEBUG, + 'trace': logging.DEBUG, +} +if args.verbose: + logging.getLogger().setLevel(logStringToPython[args.verbose]) + + def getOnlyNodeOfType(g, nodeType): """ Helper function to get a node of 'nodeType' in the graph 'g' and raise if no or multiple candidates. """ nodes = g.nodesOfType(nodeType) @@ -137,6 +153,9 @@ with multiview.GraphModification(graph): if not graph.canComputeLeaves: raise RuntimeError("Graph cannot be computed. Check for compatibility issues.") + if args.verbose: + graph.setVerbose(args.verbose) + if args.output: publish = getOnlyNodeOfType(graph, 'Publish') publish.output.value = args.output