diff options
author | Fabien Castan <fabcastan@gmail.com> | 2021-10-19 16:48:41 +0300 |
---|---|---|
committer | Fabien Castan <fabcastan@gmail.com> | 2021-10-19 16:48:41 +0300 |
commit | e5b82cb1377398a4d7fe60cb2488bb3f3e925b81 (patch) | |
tree | e91d58cdb9021a0b9e394a95f181ee65ef2b30a8 /bin | |
parent | ae0c65f563cdbdf899be41f09cd64c0df7e479c1 (diff) |
[bin] meshroom_batch: Add verbose option
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/meshroom_batch | 19 |
1 files changed, 19 insertions, 0 deletions
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 |