diff --git a/meshroom/multiview.py b/meshroom/multiview.py index 23c6f15a..0956d7ff 100644 --- a/meshroom/multiview.py +++ b/meshroom/multiview.py @@ -81,16 +81,15 @@ def sfmPipeline(graph): input=cameraInit.output) imageMatching = graph.addNewNode('ImageMatching', input=featureExtraction.input, - featuresFolder=featureExtraction.output, - ) + featuresFolders=[featureExtraction.output]) featureMatching = graph.addNewNode('FeatureMatching', input=imageMatching.input, - featuresFolder=imageMatching.featuresFolder, + featuresFolders=imageMatching.featuresFolders, imagePairsList=imageMatching.output) structureFromMotion = graph.addNewNode('StructureFromMotion', input=featureMatching.input, - featuresFolder=featureMatching.featuresFolder, - matchesFolder=featureMatching.output) + featuresFolders=featureMatching.featuresFolders, + matchesFolders=[featureMatching.output]) return [ cameraInit, featureExtraction, @@ -163,16 +162,16 @@ def sfmAugmentation(graph, sourceSfm, withMVS=False): input=cameraInit.output) imageMatchingMulti = graph.addNewNode('ImageMatchingMultiSfM', input=featureExtraction.input, - featuresFolder=featureExtraction.output + featuresFolders=[featureExtraction.output] ) featureMatching = graph.addNewNode('FeatureMatching', input=imageMatchingMulti.outputCombinedSfM, - featuresFolder=imageMatchingMulti.featuresFolder, + featuresFolders=imageMatchingMulti.featuresFolders, imagePairsList=imageMatchingMulti.output) structureFromMotion = graph.addNewNode('StructureFromMotion', input=featureMatching.input, - featuresFolder=featureMatching.featuresFolder, - matchesFolder=featureMatching.output) + featuresFolders=featureMatching.featuresFolders, + matchesFolders=[featureMatching.output]) graph.addEdge(sourceSfm.output, imageMatchingMulti.inputB) sfmNodes = [ diff --git a/meshroom/nodes/aliceVision/CameraInit.py b/meshroom/nodes/aliceVision/CameraInit.py index f22614b9..c593f72b 100644 --- a/meshroom/nodes/aliceVision/CameraInit.py +++ b/meshroom/nodes/aliceVision/CameraInit.py @@ -63,6 +63,13 @@ class CameraInit(desc.CommandLineNode): description="Camera Intrinsics", group="", ), + desc.File( + name='sensorDatabase', + label='Sensor Database', + description='''Camera sensor width database path.''', + value=os.environ.get('ALICEVISION_SENSOR_DB', ''), + uid=[], + ), desc.FloatParam( name='defaultFieldOfView', label='Default Field Of View', @@ -71,13 +78,6 @@ class CameraInit(desc.CommandLineNode): range=(0, 180.0, 1), uid=[0], ), - desc.File( - name='sensorDatabase', - label='Sensor Database', - description='''Camera sensor width database path.''', - value=os.environ.get('ALICEVISION_SENSOR_DB', ''), - uid=[], - ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', @@ -92,7 +92,7 @@ class CameraInit(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output', + label='Output SfMData File', description='''Output SfMData.''', value='{cache}/{nodeType}/{uid0}/cameraInit.sfm', uid=[], @@ -136,6 +136,7 @@ class CameraInit(desc.CommandLineNode): # Reload result of aliceVision_cameraInit cameraInitSfM = node.output.value jsonData = open(cameraInitSfM, 'r').read() + jsonData = jsonData.decode('utf8', errors='ignore') data = json.loads(jsonData) intrinsicsKeys = [i.name for i in Intrinsic] diff --git a/meshroom/nodes/aliceVision/CameraLocalization.py b/meshroom/nodes/aliceVision/CameraLocalization.py index eb02d3d8..bb94d63a 100644 --- a/meshroom/nodes/aliceVision/CameraLocalization.py +++ b/meshroom/nodes/aliceVision/CameraLocalization.py @@ -39,8 +39,8 @@ class CameraLocalization(desc.CommandLineNode): name='matchDescTypes', label='Match Desc Types', description='''Describer types to use for the matching.''', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', 'AKAZE_OCV'], + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', @@ -48,9 +48,9 @@ class CameraLocalization(desc.CommandLineNode): desc.ChoiceParam( name='preset', label='Preset', - description='''Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}''', - value='NORMAL', - values=['LOW', 'MEDIUM', 'NORMAL', 'HIGH', 'ULTRA'], + description='''Preset for the feature extractor when localizing a new image (low, medium, normal, high, ultra)''', + value='normal', + values=['low', 'medium', 'normal', 'high', 'ultra'], exclusive=True, uid=[0], ), @@ -212,10 +212,10 @@ class CameraLocalization(desc.CommandLineNode): uid=[], ), desc.File( - name='outputBinary', - label='Output Binary', - description='''Filename for the localization results (raw data) as .bin''', - value='{cache}/{nodeType}/{uid0}/trackedCameras.bin', + name='outputJSON', + label='Output JSON', + description='''Filename for the localization results as .json''', + value='{cache}/{nodeType}/{uid0}/trackedCameras.json', uid=[], ), ] diff --git a/meshroom/nodes/aliceVision/CameraRigCalibration.py b/meshroom/nodes/aliceVision/CameraRigCalibration.py index bcdc21ee..540fcdea 100644 --- a/meshroom/nodes/aliceVision/CameraRigCalibration.py +++ b/meshroom/nodes/aliceVision/CameraRigCalibration.py @@ -46,9 +46,8 @@ class CameraRigCalibration(desc.CommandLineNode): name='matchDescTypes', label='Match Describer Types', description='''The describer types to use for the matching''', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', - 'AKAZE_OCV'], + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', @@ -56,9 +55,9 @@ class CameraRigCalibration(desc.CommandLineNode): desc.ChoiceParam( name='preset', label='Preset', - description='''Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}''', - value='NORMAL', - values=['LOW', 'MEDIUM', 'NORMAL', 'HIGH', 'ULTRA'], + description='''Preset for the feature extractor when localizing a new image (low, medium, normal, high, ultra)''', + value='normal', + values=['low', 'medium', 'normal', 'high', 'ultra'], exclusive=True, uid=[0], ), diff --git a/meshroom/nodes/aliceVision/CameraRigLocalization.py b/meshroom/nodes/aliceVision/CameraRigLocalization.py index 8369c9a8..19c53b0f 100644 --- a/meshroom/nodes/aliceVision/CameraRigLocalization.py +++ b/meshroom/nodes/aliceVision/CameraRigLocalization.py @@ -46,9 +46,8 @@ class CameraRigLocalization(desc.CommandLineNode): name='matchDescTypes', label='Match Describer Types', description='''The describer types to use for the matching''', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', - 'AKAZE_OCV'], + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', @@ -56,9 +55,9 @@ class CameraRigLocalization(desc.CommandLineNode): desc.ChoiceParam( name='preset', label='Preset', - description='''Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}''', - value='NORMAL', - values=['LOW', 'MEDIUM', 'NORMAL', 'HIGH', 'ULTRA'], + description='''Preset for the feature extractor when localizing a new image (low, medium, normal, high, ultra)''', + value='normal', + values=['low', 'medium', 'normal', 'high', 'ultra'], exclusive=True, uid=[0], ), diff --git a/meshroom/nodes/aliceVision/ConvertAnimatedCamera.py b/meshroom/nodes/aliceVision/ConvertAnimatedCamera.py index 1c9e749f..0a15fc10 100644 --- a/meshroom/nodes/aliceVision/ConvertAnimatedCamera.py +++ b/meshroom/nodes/aliceVision/ConvertAnimatedCamera.py @@ -13,14 +13,14 @@ class ConvertAnimatedCamera(desc.CommandLineNode): description='''SfMData file.''', value='', uid=[0], - ), + ), ] outputs = [ desc.File( name='output', label='Output', - description='''Path to the output Alembic file.''', + description='Path to the output Alembic file.', value='{cache}/{nodeType}/{uid0}/animatedCamera.abc', uid=[], ), diff --git a/meshroom/nodes/aliceVision/ConvertSfMFormat.py b/meshroom/nodes/aliceVision/ConvertSfMFormat.py index 593833e1..4577f2a5 100644 --- a/meshroom/nodes/aliceVision/ConvertSfMFormat.py +++ b/meshroom/nodes/aliceVision/ConvertSfMFormat.py @@ -10,71 +10,71 @@ class ConvertSfMFormat(desc.CommandLineNode): desc.File( name='input', label='Input', - description='''SfMData file.''', + description='SfMData file.', value='', uid=[0], - ), + ), desc.ChoiceParam( name='fileExt', label='SfM File Format', - description='''SfM File Format''', + description='SfM File Format', value='abc', - values=['abc', 'sfm', 'ply', 'bin', 'json'], + values=['abc', 'sfm', 'json', 'ply', 'baf'], exclusive=True, uid=[0], group='', # exclude from command line - ), + ), desc.BoolParam( name='views', label='Views', - description='''Export views.''', + description='Export views.', value=True, uid=[0], - ), + ), desc.BoolParam( name='intrinsics', label='Intrinsics', - description='''Export intrinsics.''', + description='Export intrinsics.', value=True, uid=[0], - ), + ), desc.BoolParam( name='extrinsics', label='Extrinsics', - description='''Export extrinsics.''', + description='Export extrinsics.', value=True, uid=[0], - ), + ), desc.BoolParam( name='structure', label='Structure', - description='''Export structure.''', + description='Export structure.', value=True, uid=[0], - ), + ), desc.BoolParam( name='observations', label='Observations', - description='''Export observations.''', + description='Export observations.', value=True, 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, uid=[0], - ), + ), ] outputs = [ desc.File( name='output', label='Output', - description='''Path to the output SfM Data file.''', + description='Path to the output SfM Data file.', value='{cache}/{nodeType}/{uid0}/sfm.{fileExtValue}', uid=[], ), diff --git a/meshroom/nodes/aliceVision/ExportAnimatedCamera.py b/meshroom/nodes/aliceVision/ExportAnimatedCamera.py new file mode 100644 index 00000000..dc7497bf --- /dev/null +++ b/meshroom/nodes/aliceVision/ExportAnimatedCamera.py @@ -0,0 +1,42 @@ +from meshroom.core import desc + + +class ExportAnimatedCamera(desc.CommandLineNode): + internalFolder = '{cache}/{nodeType}/{uid0}/' + commandLine = 'aliceVision_exportAnimatedCamera {allParams}' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description='SfMData file containing a complete SfM.', + value='', + uid=[0], + ), + desc.File( + name='filter', + label='SfMData Filter', + description='A SfMData file use as filter.', + value='', + uid=[0], + ), + desc.ChoiceParam( + name='verboseLevel', + label='Verbose Level', + description='Verbosity level (fatal, error, warning, info, debug, trace).', + value='info', + values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'], + exclusive=True, + uid=[], + ) + ] + + outputs = [ + desc.File( + name='output', + label='Output filename', + description='Output filename for the alembic animated camera.', + value='{cache}/{nodeType}/{uid0}/camera.abc', + uid=[], + ), + ] diff --git a/meshroom/nodes/aliceVision/ExportUndistortedImages.py b/meshroom/nodes/aliceVision/ExportUndistortedImages.py new file mode 100644 index 00000000..3c15bff3 --- /dev/null +++ b/meshroom/nodes/aliceVision/ExportUndistortedImages.py @@ -0,0 +1,43 @@ +from meshroom.core import desc + +class ExportUndistortedImages(desc.CommandLineNode): + internalFolder = '{cache}/{nodeType}/{uid0}/' + commandLine = 'aliceVision_exportUndistortedImages {allParams}' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description='SfMData file containing a complete SfM.', + value='', + uid=[0], + ), + desc.ChoiceParam( + name='outputFileType', + label='Output File Type', + description='Output file type for the undistorted images.', + value='exr', + values=['jpg', 'png', 'tif', 'exr'], + exclusive=True, + uid=[0], + ), + desc.ChoiceParam( + name='verboseLevel', + label='Verbose Level', + description='Verbosity level (fatal, error, warning, info, debug, trace).', + value='info', + values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'], + exclusive=True, + uid=[], + ) + ] + + outputs = [ + desc.File( + name='output', + label='Output Folder', + description='Output folder for the undistorted images.', + value='{cache}/{nodeType}/{uid0}/', + uid=[], + ), + ] diff --git a/meshroom/nodes/aliceVision/FeatureExtraction.py b/meshroom/nodes/aliceVision/FeatureExtraction.py index a5a4a162..5666ed27 100644 --- a/meshroom/nodes/aliceVision/FeatureExtraction.py +++ b/meshroom/nodes/aliceVision/FeatureExtraction.py @@ -13,16 +13,16 @@ class FeatureExtraction(desc.CommandLineNode): desc.File( name='input', label='Input', - description='''SfMData file.''', + description='SfMData file.', value='', uid=[0], ), desc.ChoiceParam( name='describerTypes', label='Describer Types', - description='''Describer types used to describe an image.''', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', 'AKAZE_OCV'], + description='Describer types used to describe an image.', + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', @@ -30,30 +30,23 @@ class FeatureExtraction(desc.CommandLineNode): desc.ChoiceParam( name='describerPreset', label='Describer Preset', - description='''Control the ImageDescriber configuration (low, medium, normal, high, ultra). Configuration 'ultra' can take long time !''', - value='NORMAL', - values=['LOW', 'MEDIUM', 'NORMAL', 'HIGH', 'ULTRA'], + description='Control the ImageDescriber configuration (low, medium, normal, high, ultra). Configuration "ultra" can take long time !', + value='normal', + values=['low', 'medium', 'normal', 'high', 'ultra'], exclusive=True, uid=[0], ), - desc.BoolParam( - name='upright', - label='Upright', - description='''Upright feature.''', - value=False, - uid=[0], - ), desc.BoolParam( name='forceCpuExtraction', label='Force CPU Extraction', - description='''Use only CPU feature extraction.''', + description='Use only CPU feature extraction.', value=True, uid=[], ), 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, @@ -64,8 +57,8 @@ class FeatureExtraction(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output', - description='''Output path for the features and descriptors files (*.feat, *.desc).''', + label='Output Folder', + description='Output path for the features and descriptors files (*.feat, *.desc).', value='{cache}/{nodeType}/{uid0}/', uid=[], ), diff --git a/meshroom/nodes/aliceVision/FeatureMatching.py b/meshroom/nodes/aliceVision/FeatureMatching.py index 974f1d4b..7612ec8a 100644 --- a/meshroom/nodes/aliceVision/FeatureMatching.py +++ b/meshroom/nodes/aliceVision/FeatureMatching.py @@ -13,49 +13,39 @@ class FeatureMatching(desc.CommandLineNode): desc.File( name='input', label='Input', - description='''SfMData file.''', + description='SfMData file.', value='', uid=[0], ), - desc.ChoiceParam( - name='geometricModel', - label='Geometric Model', - description='Geometric validation method to filter features matches:\n' - ' * f: fundamental matrix\n' - ' * e: essential matrix\n' - ' * h: homography matrix\n' - ' * hg: homography growing\n' - ' * none: no geometric filtering', - value='f', - values=['f', 'e', 'h', 'hg', 'none'], - exclusive=True, + desc.ListAttribute( + elementDesc=desc.File( + name="featuresFolder", + label="Features Folder", + description="", + value="", + uid=[0], + ), + name="featuresFolders", + label="Features Folders", + description="Folder(s) containing the extracted features and descriptors." + ), + desc.File( + name='imagePairsList', + label='Image Pairs List', + description='Path to a file which contains the list of image pairs to match.', + value='', uid=[0], ), desc.ChoiceParam( name='describerTypes', label='Describer Types', - description='''Describer types used to describe an image.''', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', - 'AKAZE_OCV'], + description='Describer types used to describe an image.', + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', ), - desc.File( - name='featuresFolder', - label='Features Folder', - description='''Path to a folder containing the extracted features.''', - value='', - uid=[0], - ), - desc.File( - name='imagePairsList', - label='Image Pairs List', - description='''Path to a file which contains the list of image pairs to match.''', - value='', - uid=[0], - ), desc.ChoiceParam( name='photometricMatchingMethod', label='Photometric Matching Method', @@ -74,30 +64,30 @@ class FeatureMatching(desc.CommandLineNode): desc.ChoiceParam( name='geometricEstimator', label='Geometric Estimator', - description='''Geometric estimator: * acransac: A-Contrario Ransac * loransac: LO-Ransac (only available for fundamental matrix)''', + description='Geometric estimator: (acransac: A-Contrario Ransac, loransac: LO-Ransac (only available for "fundamental_matrix" model)', value='acransac', values=['acransac', 'loransac'], exclusive=True, uid=[0], ), - desc.BoolParam( - name='savePutativeMatches', - label='Save Putative Matches', - description='''putative matches.''', - value=False, - uid=[0], - ), - desc.BoolParam( - name='guidedMatching', - label='Guided Matching', - description='''the found model to improve the pairwise correspondences.''', - value=False, + desc.ChoiceParam( + name='geometricFilterType', + label='Geometric Filter Type', + description='Geometric validation method to filter features matches: \n' + ' * fundamental_matrix\n' + ' * essential_matrix\n' + ' * homography_matrix\n' + ' * homography_growing\n' + ' * no_filtering', + value='fundamental_matrix', + values=['fundamental_matrix', 'essential_matrix', 'homography_matrix', 'homography_growing', 'no_filtering'], + exclusive=True, uid=[0], ), desc.FloatParam( name='distanceRatio', label='Distance Ratio', - description='''Distance ratio to discard non meaningful matches.''', + description='Distance ratio to discard non meaningful matches.', value=0.8, range=(0.0, 1.0, 0.01), uid=[0], @@ -105,42 +95,55 @@ class FeatureMatching(desc.CommandLineNode): desc.IntParam( name='maxIteration', label='Max Iteration', - description='''Maximum number of iterations allowed in ransac step.''', + description='Maximum number of iterations allowed in ransac step.', value=2048, range=(1, 20000, 1), uid=[0], ), + desc.IntParam( + name='maxMatches', + label='Max Matches', + description='Maximum number of matches to keep.', + value=0, + range=(0, 10000, 1), + uid=[0], + ), + desc.BoolParam( + name='savePutativeMatches', + label='Save Putative Matches', + description='putative matches.', + value=False, + uid=[0], + ), + desc.BoolParam( + name='guidedMatching', + label='Guided Matching', + description='the found model to improve the pairwise correspondences.', + value=False, + uid=[0], + ), desc.BoolParam( name='exportDebugFiles', label='Export Debug Files', - description='''debug files (svg, dot).''', + description='debug files (svg, dot).', value=False, uid=[], ), - desc.IntParam( - name='maxMatches', - label='Max Matches', - description='''Maximum number pf matches to keep.''', - value=0, - range=(0, 10000, 1), - 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, uid=[], ) ] - outputs = [ desc.File( name='output', - label='Output', - description='''Path to a folder in which computed matches will be stored.''', + label='Output Folder', + description='Path to a folder in which computed matches will be stored.', value='{cache}/{nodeType}/{uid0}/', uid=[], ), diff --git a/meshroom/nodes/aliceVision/ImageMatching.py b/meshroom/nodes/aliceVision/ImageMatching.py index 37059a7f..92b68020 100644 --- a/meshroom/nodes/aliceVision/ImageMatching.py +++ b/meshroom/nodes/aliceVision/ImageMatching.py @@ -12,28 +12,40 @@ class ImageMatching(desc.CommandLineNode): desc.File( name='input', label='Input', - description='''SfMData file .''', + description='SfMData file .', value='', uid=[0], ), - desc.File( - name='featuresFolder', - label='Features Folder', - description='''Folder containing the extracted features and descriptors. By default, it is the folder containing the SfMData.''', - value='', - uid=[0], + desc.ListAttribute( + elementDesc=desc.File( + name="featuresFolder", + label="Features Folder", + description="", + value="", + uid=[0], + ), + name="featuresFolders", + label="Features Folders", + description="Folder(s) containing the extracted features and descriptors." ), desc.File( name='tree', label='Tree', - description='''Input name for the vocabulary tree file.''', + description='Input name for the vocabulary tree file.', value=os.environ.get('ALICEVISION_VOCTREE', ''), uid=[0], ), + desc.File( + name='weights', + label='Weights', + description='Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.', + value='', + uid=[0], + ), desc.IntParam( name='minNbImages', label='Minimal Number of Images', - description='''Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.''', + description='Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.', value=200, range=(0, 500, 1), uid=[0], @@ -41,7 +53,7 @@ class ImageMatching(desc.CommandLineNode): desc.IntParam( name='maxDescriptors', label='Max Descriptors', - description='''Limit the number of descriptors you load per image. Zero means no limit.''', + description='Limit the number of descriptors you load per image. Zero means no limit.', value=500, range=(0, 100000, 1), uid=[0], @@ -49,22 +61,15 @@ class ImageMatching(desc.CommandLineNode): desc.IntParam( name='nbMatches', label='Nb Matches', - description='''The number of matches to retrieve for each image (If 0 it will retrieve all the matches).''', + description='The number of matches to retrieve for each image (If 0 it will retrieve all the matches).', value=50, range=(0, 1000, 1), uid=[0], ), - desc.File( - name='weights', - label='Weights', - description='''Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.''', - 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, @@ -75,8 +80,8 @@ class ImageMatching(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output', - description='''Filepath to the output file with the list of selected image pairs.''', + label='Output List File', + description='Filepath to the output file with the list of selected image pairs.', value='{cache}/{nodeType}/{uid0}/imageMatches.txt', uid=[], ), diff --git a/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py b/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py index 2a7e18fe..0af06962 100644 --- a/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py +++ b/meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py @@ -13,44 +13,56 @@ class ImageMatchingMultiSfM(desc.CommandLineNode): desc.File( name='input', label='Input A', - description='''SfMData file .''', + description='SfMData file .', value='', uid=[0], ), desc.File( name='inputB', label='Input B', - description='''SfMData file .''', + description='SfMData file .', + value='', + uid=[0], + ), + desc.ListAttribute( + elementDesc=desc.File( + name="featuresFolder", + label="Features Folder", + description="", + value="", + uid=[0], + ), + name="featuresFolders", + label="Features Folders", + description="Folder(s) containing the extracted features and descriptors." + ), + desc.File( + name='tree', + label='Tree', + description='Input name for the vocabulary tree file.', + value=os.environ.get('ALICEVISION_VOCTREE', ''), + uid=[0], + ), + desc.File( + name='weights', + label='Weights', + description='Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.', value='', uid=[0], ), desc.ChoiceParam( name='modeMultiSfM', label='Multiple SfM mode', - description='''Image matching multiple SfM mode. "a_ab" for images in input SfMData A plus between A and B. "a_b" for images between input SfMData A and B''', + description='Image matching multiple SfM mode.\n"a_ab" for images in input SfMData A plus between A and B.\n"a_b" for images between input SfMData A and B.', value='a_ab', values=['a_ab', 'a_b'], exclusive=True, uid=[0], ), - desc.File( - name='featuresFolder', - label='Features Folder', - description='''Folder containing the extracted features and descriptors. By default, it is the folder containing the SfMData.''', - value='', - uid=[0], - ), - desc.File( - name='tree', - label='Tree', - description='''Input name for the vocabulary tree file.''', - value=os.environ.get('ALICEVISION_VOCTREE', ''), - uid=[0], - ), desc.IntParam( name='minNbImages', label='Minimal Number of Images', - description='''Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.''', + description='Minimal number of images to use the vocabulary tree. If we have less features than this threshold, we will compute all matching combinations.', value=200, range=(0, 500, 1), uid=[0], @@ -58,7 +70,7 @@ class ImageMatchingMultiSfM(desc.CommandLineNode): desc.IntParam( name='maxDescriptors', label='Max Descriptors', - description='''Limit the number of descriptors you load per image. Zero means no limit.''', + description='Limit the number of descriptors you load per image. Zero means no limit.', value=500, range=(0, 100000, 1), uid=[0], @@ -66,22 +78,15 @@ class ImageMatchingMultiSfM(desc.CommandLineNode): desc.IntParam( name='nbMatches', label='Nb Matches', - description='''The number of matches to retrieve for each image (If 0 it will retrieve all the matches).''', + description='The number of matches to retrieve for each image (If 0 it will retrieve all the matches).', value=50, range=(0, 1000, 1), uid=[0], ), - desc.File( - name='weights', - label='Weights', - description='''Input name for the weight file, if not provided the weights will be computed on the database built with the provided set.''', - 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, @@ -92,15 +97,15 @@ class ImageMatchingMultiSfM(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output', - description='''Filepath to the output file with the list of selected image pairs.''', + label='Output List File', + description='Filepath to the output file with the list of selected image pairs.', value='{cache}/{nodeType}/{uid0}/imageMatches.txt', uid=[], ), desc.File( name='outputCombinedSfM', label='Output Combined SfM', - description='''Path for the combined SfMData file''', + description='Path for the combined SfMData file', value='{cache}/{nodeType}/{uid0}/combineSfM.sfm', uid=[], ), diff --git a/meshroom/nodes/aliceVision/Publish.py b/meshroom/nodes/aliceVision/Publish.py index 10127a0c..6cd147c5 100644 --- a/meshroom/nodes/aliceVision/Publish.py +++ b/meshroom/nodes/aliceVision/Publish.py @@ -15,12 +15,12 @@ class Publish(desc.Node): description="", value="", uid=[0], - ), + ), name="inputFiles", label="Input Files", description="Input Files to publish.", group="", - ), + ), desc.File( name="output", label="Output Folder", diff --git a/meshroom/nodes/aliceVision/SfMTransform.py b/meshroom/nodes/aliceVision/SfMTransform.py index dcbade8a..9016883b 100644 --- a/meshroom/nodes/aliceVision/SfMTransform.py +++ b/meshroom/nodes/aliceVision/SfMTransform.py @@ -35,9 +35,9 @@ class SfMTransform(desc.CommandLineNode): desc.ChoiceParam( name='landmarksDescriberTypes', label='Landmarks Describer Types', - description='''Image describer types used to compute the mean of the point cloud. (only for 'landmarks' method)''', - value=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', 'AKAZE_OCV'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', 'AKAZE_OCV'], + description='Image describer types used to compute the mean of the point cloud. (only for "landmarks" method).', + value=['sift', 'akaze'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', diff --git a/meshroom/nodes/aliceVision/StructureFromMotion.py b/meshroom/nodes/aliceVision/StructureFromMotion.py index 8fdbf292..fad5215b 100644 --- a/meshroom/nodes/aliceVision/StructureFromMotion.py +++ b/meshroom/nodes/aliceVision/StructureFromMotion.py @@ -17,39 +17,48 @@ class StructureFromMotion(desc.CommandLineNode): value='', uid=[0], ), - desc.File( - name='featuresFolder', - label='Features Folder', - description='Path to a folder containing the extracted features.', - value='', - uid=[0], + desc.ListAttribute( + elementDesc=desc.File( + name="featuresFolder", + label="Features Folder", + description="", + value="", + uid=[0], + ), + name="featuresFolders", + label="Features Folders", + description="Folder(s) containing the extracted features and descriptors." ), - desc.File( - name='matchesFolder', - label='Matches Folder', - description='Path to a folder in which computed matches are stored.', - value='', - uid=[0], + desc.ListAttribute( + elementDesc=desc.File( + name="matchesFolder", + label="Matches Folder", + description="", + value="", + uid=[0], + ), + name="matchesFolders", + label="Matches Folders", + description="Folder(s) in which computed matches are stored." ), desc.ChoiceParam( name='describerTypes', label='Describer Types', description='Describer types used to describe an image.', - value=['SIFT'], - values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', - 'AKAZE_OCV'], + value=['sift'], + values=['sift', 'sift_float', 'sift_upright', 'akaze', 'akaze_liop', 'akaze_mldb', 'cctag3', 'cctag4', 'sift_ocv', 'akaze_ocv'], exclusive=False, uid=[0], joinChar=',', ), desc.ChoiceParam( - name='interFileExtension', - label='Inter File Extension', - description='Extension of the intermediate file export.', - value='.abc', - values=('.abc', '.ply'), + name='localizerEstimator', + label='Localizer Estimator', + description='Estimator type used to localize cameras (acransac, ransac, lsmeds, loransac, maxconsensus).', + value='acransac', + values=['acransac', 'ransac', 'lsmeds', 'loransac', 'maxconsensus'], exclusive=True, - uid=[], + uid=[0], ), desc.BoolParam( name='useLocalBA', @@ -67,13 +76,14 @@ class StructureFromMotion(desc.CommandLineNode): range=(2, 10, 1), uid=[0], ), - desc.ChoiceParam( - name='localizerEstimator', - label='Localizer Estimator', - description='Estimator type used to localize cameras (acransac, ransac, lsmeds, loransac, maxconsensus).', - value='acransac', - values=['acransac', 'ransac', 'lsmeds', 'loransac', 'maxconsensus'], - exclusive=True, + desc.IntParam( + name='maxNumberOfMatches', + label='Maximum Number of Matches', + description='Maximum number of matches per image pair (and per feature type). \n' + 'This can be useful to have a quick reconstruction overview. \n' + '0 means no limit.', + value=0, + range=(0, 50000, 1), uid=[0], ), desc.IntParam( @@ -95,16 +105,54 @@ class StructureFromMotion(desc.CommandLineNode): range=(2, 10, 1), uid=[0], ), - desc.IntParam( - name='maxNumberOfMatches', - label='Maximum Number of Matches', - description='Maximum number of matches per image pair (and per feature type). \n' - 'This can be useful to have a quick reconstruction overview. \n' - '0 means no limit.', - value=0, - range=(0, 50000, 1), + desc.FloatParam( + name='minAngleForTriangulation', + label='Min Angle For Triangulation', + description='Minimum angle for triangulation.', + value=3.0, + range=(0.1, 10, 0.1), uid=[0], ), + desc.FloatParam( + name='minAngleForLandmark', + label='Min Angle For Landmark', + description='Minimum angle for landmark.', + value=2.0, + range=(0.1, 10, 0.1), + uid=[0], + ), + desc.FloatParam( + name='maxReprojectionError', + label='Max Reprojection Error', + description='Maximum reprojection error.', + value=4.0, + range=(0.1, 10, 0.1), + uid=[0], + ), + desc.FloatParam( + name='minAngleInitialPair', + label='Min Angle Initial Pair', + description='Minimum angle for the initial pair.', + value=5.0, + range=(0.1, 10, 0.1), + uid=[0], + ), + desc.FloatParam( + name='maxAngleInitialPair', + label='Max Angle Initial Pair', + description='Maximum angle for the initial pair.', + value=40.0, + range=(0.1, 60, 0.1), + uid=[0], + ), + desc.BoolParam( + name='useOnlyMatchesFromInputFolder', + label='Use Only Matches From Input Folder', + description='Use only matches from the input matchesFolder parameter.\n' + 'Matches folders previously added to the SfMData file will be ignored.', + value=False, + uid=[], + ), desc.File( name='initialPairA', label='Initial Pair A', @@ -119,6 +167,15 @@ class StructureFromMotion(desc.CommandLineNode): value='', uid=[0], ), + desc.ChoiceParam( + name='interFileExtension', + label='Inter File Extension', + description='Extension of the intermediate file export.', + value='.abc', + values=('.abc', '.ply'), + exclusive=True, + uid=[], + ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', @@ -133,21 +190,21 @@ class StructureFromMotion(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output SfM data file', + label='Output SfMData File', description='Path to the output sfmdata file', value='{cache}/{nodeType}/{uid0}/sfm.abc', uid=[], ), desc.File( name='outputViewsAndPoses', - label='Output SfM data file', + label='Output SfMData File', description='''Path to the output sfmdata file with cameras (views and poses).''', value='{cache}/{nodeType}/{uid0}/cameras.sfm', uid=[], ), desc.File( name='extraInfoFolder', - label='Output', + label='Output Folder', description='Folder for intermediate reconstruction files and additional reconstruction information files.', value='{cache}/{nodeType}/{uid0}/', uid=[],