From ce25724023ea23986a460b9b00274d32d73bd7aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20De=20Lillo?= Date: Wed, 8 Aug 2018 18:33:05 +0200 Subject: [PATCH] [multiview] Use SfMData as input in MVS pipeline --- meshroom/multiview.py | 20 +++++++++----- .../nodes/aliceVision/CameraConnection.py | 27 +++++++++++++++---- meshroom/nodes/aliceVision/DepthMap.py | 22 ++++++++++++--- meshroom/nodes/aliceVision/DepthMapFilter.py | 21 ++++++++++----- meshroom/nodes/aliceVision/Meshing.py | 15 ++++++++--- .../nodes/aliceVision/PrepareDenseScene.py | 11 ++------ meshroom/nodes/aliceVision/Texturing.py | 13 ++++++--- 7 files changed, 90 insertions(+), 39 deletions(-) diff --git a/meshroom/multiview.py b/meshroom/multiview.py index 8a1fcc20..346f4a7e 100644 --- a/meshroom/multiview.py +++ b/meshroom/multiview.py @@ -122,20 +122,26 @@ def mvsPipeline(graph, sfm=None): prepareDenseScene = graph.addNewNode('PrepareDenseScene', input=sfm.output if sfm else "") cameraConnection = graph.addNewNode('CameraConnection', - ini=prepareDenseScene.ini) + input=prepareDenseScene.input, + imagesFolder=prepareDenseScene.output) depthMap = graph.addNewNode('DepthMap', - ini=cameraConnection.ini) + input=cameraConnection.input, + cameraPairsMatrixFolder=cameraConnection.output, + imagesFolder=cameraConnection.imagesFolder) depthMapFilter = graph.addNewNode('DepthMapFilter', - depthMapFolder=depthMap.output, - ini=depthMap.ini) + input=depthMap.input, + cameraPairsMatrixFolder=depthMap.cameraPairsMatrixFolder, + depthMapFolder=depthMap.output) meshing = graph.addNewNode('Meshing', + input=depthMapFilter.input, + cameraPairsMatrixFolder=depthMapFilter.cameraPairsMatrixFolder, depthMapFolder=depthMapFilter.depthMapFolder, - depthMapFilterFolder=depthMapFilter.output, - ini=depthMapFilter.ini) + depthMapFilterFolder=depthMapFilter.output) meshFiltering = graph.addNewNode('MeshFiltering', input=meshing.output) texturing = graph.addNewNode('Texturing', - ini=meshing.ini, + input=meshing.input, + imagesFolder=depthMap.imagesFolder, inputDenseReconstruction=meshing.outputDenseReconstruction, inputMesh=meshFiltering.output) diff --git a/meshroom/nodes/aliceVision/CameraConnection.py b/meshroom/nodes/aliceVision/CameraConnection.py index e0c2d217..1f103c37 100644 --- a/meshroom/nodes/aliceVision/CameraConnection.py +++ b/meshroom/nodes/aliceVision/CameraConnection.py @@ -6,20 +6,27 @@ from meshroom.core import desc class CameraConnection(desc.CommandLineNode): internalFolder = desc.Node.internalFolder commandLine = 'aliceVision_cameraConnection {allParams}' - size = desc.DynamicNodeSize('ini') + size = desc.DynamicNodeSize('input') inputs = [ desc.File( - name="ini", - label='MVS Configuration file', - description='', + name='input', + label='Input', + description='SfMData file.', + value='', + uid=[0], + ), + desc.File( + name='imagesFolder', + label='Images Folder', + description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.', value='', uid=[0], ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', - description='''verbosity level (fatal, error, warning, info, debug, trace).''', + description='verbosity level (fatal, error, warning, info, debug, trace).', value='info', values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'], exclusive=True, @@ -27,3 +34,13 @@ class CameraConnection(desc.CommandLineNode): ), ] + outputs = [ + desc.File( + name='output', + label='Output', + description='Output folder for the camera pairs matrix file.', + value=desc.Node.internalFolder, + uid=[], + ) +] + diff --git a/meshroom/nodes/aliceVision/DepthMap.py b/meshroom/nodes/aliceVision/DepthMap.py index d49e8046..039670be 100644 --- a/meshroom/nodes/aliceVision/DepthMap.py +++ b/meshroom/nodes/aliceVision/DepthMap.py @@ -6,15 +6,29 @@ from meshroom.core import desc class DepthMap(desc.CommandLineNode): commandLine = 'aliceVision_depthMapEstimation {allParams}' gpu = desc.Level.INTENSIVE - size = desc.DynamicNodeSize('ini') + size = desc.DynamicNodeSize('input') parallelization = desc.Parallelization(blockSize=3) commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}' inputs = [ desc.File( - name="ini", - label='MVS Configuration File', - description='', + name='input', + label='Input', + description='SfMData file.', + value='', + uid=[0], + ), + desc.File( + name='cameraPairsMatrixFolder', + label='Camera Pairs Matrix Folder', + description='Camera pairs matrix folder.', + value='', + uid=[0], + ), + desc.File( + name='imagesFolder', + label='Images Folder', + description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.', value='', uid=[0], ), diff --git a/meshroom/nodes/aliceVision/DepthMapFilter.py b/meshroom/nodes/aliceVision/DepthMapFilter.py index d960617c..f112696f 100644 --- a/meshroom/nodes/aliceVision/DepthMapFilter.py +++ b/meshroom/nodes/aliceVision/DepthMapFilter.py @@ -6,25 +6,32 @@ from meshroom.core import desc class DepthMapFilter(desc.CommandLineNode): commandLine = 'aliceVision_depthMapFiltering {allParams}' gpu = desc.Level.NORMAL - size = desc.DynamicNodeSize('ini') + size = desc.DynamicNodeSize('input') parallelization = desc.Parallelization(blockSize=10) commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}' inputs = [ desc.File( - name="ini", - label="MVS Configuration file", - description="", - value="", + name='input', + label='Input', + description='SfMData file.', + value='', uid=[0], - ), + ), + desc.File( + name='cameraPairsMatrixFolder', + label='Camera Pairs Matrix Folder', + description='Camera pairs matrix folder.', + value='', + uid=[0], + ), desc.File( name="depthMapFolder", label="Depth Map Folder", description="Input depth map folder", value="", uid=[0], - ), + ), desc.IntParam( name="nNearestCams", label="Number of Nearest Cameras", diff --git a/meshroom/nodes/aliceVision/Meshing.py b/meshroom/nodes/aliceVision/Meshing.py index 5f4c3cb0..412d02e1 100644 --- a/meshroom/nodes/aliceVision/Meshing.py +++ b/meshroom/nodes/aliceVision/Meshing.py @@ -11,12 +11,19 @@ class Meshing(desc.CommandLineNode): inputs = [ desc.File( - name="ini", - label='MVS Configuration file', - description='', + name='input', + label='Input', + description='SfMData file.', value='', uid=[0], - ), + ), + desc.File( + name='cameraPairsMatrixFolder', + label='Camera Pairs Matrix Folder', + description='Camera pairs matrix folder.', + value='', + uid=[0], + ), desc.File( name="depthMapFolder", label='Depth Maps Folder', diff --git a/meshroom/nodes/aliceVision/PrepareDenseScene.py b/meshroom/nodes/aliceVision/PrepareDenseScene.py index 529e7b86..cf80923a 100644 --- a/meshroom/nodes/aliceVision/PrepareDenseScene.py +++ b/meshroom/nodes/aliceVision/PrepareDenseScene.py @@ -6,6 +6,8 @@ from meshroom.core import desc class PrepareDenseScene(desc.CommandLineNode): commandLine = 'aliceVision_prepareDenseScene {allParams}' size = desc.DynamicNodeSize('input') + parallelization = desc.Parallelization(blockSize=40) + commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}' inputs = [ desc.File( @@ -27,15 +29,6 @@ class PrepareDenseScene(desc.CommandLineNode): ] outputs = [ - desc.File( - name='ini', - label='MVS Configuration file', - description='', - value=desc.Node.internalFolder + 'mvs.ini', - uid=[], - group='', # not a command line arg - ), - desc.File( name='output', label='Output', diff --git a/meshroom/nodes/aliceVision/Texturing.py b/meshroom/nodes/aliceVision/Texturing.py index 896b2df7..923339cb 100644 --- a/meshroom/nodes/aliceVision/Texturing.py +++ b/meshroom/nodes/aliceVision/Texturing.py @@ -9,9 +9,16 @@ class Texturing(desc.CommandLineNode): ram = desc.Level.INTENSIVE inputs = [ desc.File( - name='ini', - label='MVS Configuration file', - description='', + name='input', + label='Input', + description='SfMData file.', + value='', + uid=[0], + ), + desc.File( + name='imagesFolder', + label='Images Folder', + description='Use images from a specific folder instead of those specify in the SfMData file.\nFilename should be the image uid.', value='', uid=[0], ),