From 7e28d0f5405a84872bfbc21e71b216b61fc18ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Mon, 9 Oct 2023 18:05:05 +0200 Subject: [PATCH] [bin] `meshroom_batch`: Add support for relative input and output paths Up to this commit, `meshroom_batch` only supported absolute input and output paths: using relative ones led to a failure during the execution of the `CameraInit` node. Now, if relative paths are provided by the user, they are automatically converted to absolute ones, thus ensuring that everything will run smoothly. --- bin/meshroom_batch | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/meshroom_batch b/bin/meshroom_batch index 0a686282..e3abf590 100755 --- a/bin/meshroom_batch +++ b/bin/meshroom_batch @@ -16,11 +16,11 @@ import logging parser = argparse.ArgumentParser(description='Launch the full photogrammetry or Panorama HDR pipeline.') -parser.add_argument('-i', '--input', metavar='NODEINSTANCE:SFM/FOLDERS/IMAGES;...', type=str, nargs='*', +parser.add_argument('-i', '--input', metavar='NODEINSTANCE:"SFM/FOLDERS/IMAGES;..."', type=str, nargs='*', default=[], help='Input folder containing images or folders of images or file (.sfm or .json) ' 'with images paths and optionally predefined camera intrinsics.') -parser.add_argument('-I', '--inputRecursive', metavar='NODEINSTANCE:FOLDERS/IMAGES;...', type=str, nargs='*', +parser.add_argument('-I', '--inputRecursive', metavar='NODEINSTANCE:"FOLDERS/IMAGES;..."', type=str, nargs='*', default=[], help='Input folders containing all images recursively.') @@ -134,7 +134,7 @@ with multiview.GraphModification(graph): print('Syntax error in input argument') sys.exit(1) nodeInputs = inputGroup[-1].split(';') - mapInputs[nodeName] = nodeInputs + mapInputs[nodeName] = [os.path.abspath(path) for path in nodeInputs] return mapInputs # get init nodes @@ -170,7 +170,7 @@ with multiview.GraphModification(graph): publishNodes = graph.nodesOfType('Publish') if len(publishNodes) > 0: for node in publishNodes: - node.output.value = args.output + node.output.value = os.path.abspath(args.output) else: raise RuntimeError("meshroom_batch requires a pipeline graph with at least one Publish node, none found.")