From fecec3eb404d85b293f8b1f5370e51f2fabc53c6 Mon Sep 17 00:00:00 2001 From: Fabien Date: Fri, 6 Nov 2020 17:50:04 +0100 Subject: [PATCH 01/24] [panorama] Add a cache folder --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 7a754fe100..e782f3e569 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -28,6 +28,13 @@ class PanoramaCompositing(desc.CommandLineNode): value='', uid=[0], ), + desc.File( + name='cacheFolder', + label='Cache Folder', + description="Temporary cache directory", + value='', + uid=[0], + ), desc.File( name='warpingFolder', label='Warping Folder', From 19931141781025f58f737391f03f335091fb971b Mon Sep 17 00:00:00 2001 From: Fabien Servant Date: Mon, 23 Nov 2020 14:56:22 +0100 Subject: [PATCH 02/24] [core] more robust check of "status" file --- meshroom/core/node.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 42c2bc5713..16d68884cd 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -288,11 +288,16 @@ def updateStatusFromCache(self): self.statusFileLastModTime = -1 self._status.reset() else: - with open(statusFile, 'r') as jsonFile: - statusData = json.load(jsonFile) - self._status.fromDict(statusData) - self.statusFileLastModTime = os.path.getmtime(statusFile) - if oldStatus != self._status.status: + try: + with open(statusFile, 'r') as jsonFile: + statusData = json.load(jsonFile) + self.status.fromDict(statusData) + self.statusFileLastModTime = os.path.getmtime(statusFile) + except Exception as e: + self.statusFileLastModTime = -1 + self.status.reset() + + if oldStatus != self.status.status: self.statusChanged.emit() @property @@ -323,8 +328,11 @@ def saveStatusFile(self): data = self._status.toDict() statusFilepath = self.statusFile folder = os.path.dirname(statusFilepath) - if not os.path.exists(folder): + try: os.makedirs(folder) + except Exception as e: + pass + statusFilepathWriting = getWritingFilepath(statusFilepath) with open(statusFilepathWriting, 'w') as jsonFile: json.dump(data, jsonFile, indent=4) From ce51d3b5b6a0f58797f8a1747d4981066bea07cb Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 8 Dec 2020 12:10:13 +0100 Subject: [PATCH 03/24] [nodes] PanoramaCompositing: add optional custom cache folder --- .../nodes/aliceVision/PanoramaCompositing.py | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index e782f3e569..8485e4fd55 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -28,13 +28,6 @@ class PanoramaCompositing(desc.CommandLineNode): value='', uid=[0], ), - desc.File( - name='cacheFolder', - label='Cache Folder', - description="Temporary cache directory", - value='', - uid=[0], - ), desc.File( name='warpingFolder', label='Warping Folder', @@ -98,6 +91,15 @@ class PanoramaCompositing(desc.CommandLineNode): advanced=True, uid=[0] ), + desc.File( + name='customCacheFolder', + label='Cache Folder', + description="Temporary cache directory", + value='', + uid=[0], + group='', + advanced=True, + ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', @@ -117,4 +119,11 @@ class PanoramaCompositing(desc.CommandLineNode): value=desc.Node.internalFolder + 'panorama.{outputFileTypeValue}', uid=[], ), + desc.File( + name='cacheFolder', + label='Cache Folder', + description='Temporary cache directory', + value=lambda attr: attr.node.customCacheFolder.value if attr.node.customCacheFolder.value else (desc.Node.internalFolder + 'cache/'), + uid=[], + ), ] From a26122e5466b828d317ae32ba256c1f66e395765 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 10 Dec 2020 17:27:02 +0100 Subject: [PATCH 04/24] [ui] NodeEditor: tabs width --- meshroom/ui/qml/GraphEditor/NodeEditor.qml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/NodeEditor.qml b/meshroom/ui/qml/GraphEditor/NodeEditor.qml index 42c361db8a..f4cc2de1d4 100644 --- a/meshroom/ui/qml/GraphEditor/NodeEditor.qml +++ b/meshroom/ui/qml/GraphEditor/NodeEditor.qml @@ -199,32 +199,27 @@ Panel { currentIndex: 0 TabButton { text: "Attributes" - width: implicitWidth padding: 4 leftPadding: 8 rightPadding: leftPadding } TabButton { text: "Log" - width: implicitWidth leftPadding: 8 rightPadding: leftPadding } TabButton { text: "Statistics" - width: implicitWidth leftPadding: 8 rightPadding: leftPadding } TabButton { text: "Status" - width: implicitWidth leftPadding: 8 rightPadding: leftPadding } TabButton { text: "Documentation" - width: implicitWidth leftPadding: 8 rightPadding: leftPadding } From 66cdc03884e5a5fd472d1a0b5faa3ab40605bf7b Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 10 Dec 2020 17:28:54 +0100 Subject: [PATCH 05/24] [ui] Node stats viewer: limit curves sampling to avoid performance issues --- meshroom/ui/qml/GraphEditor/StatViewer.qml | 37 +++++++++++++++------- 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/meshroom/ui/qml/GraphEditor/StatViewer.qml b/meshroom/ui/qml/GraphEditor/StatViewer.qml index 8db23ddce0..4ffedbb0ed 100644 --- a/meshroom/ui/qml/GraphEditor/StatViewer.qml +++ b/meshroom/ui/qml/GraphEditor/StatViewer.qml @@ -29,6 +29,7 @@ Item { property int ramTotal property string ramLabel: "RAM: " + property int maxDisplayLength: 500 property int gpuTotalMemory property int gpuMaxAxis: 100 property string gpuName @@ -170,7 +171,10 @@ Item { lineSerie.append(0, categories[j][0]) lineSerie.append(root.deltaTime, categories[j][0]) } else { - for(var k = 0; k < categories[j].length; k++) { + var displayLength = Math.min(maxDisplayLength, categories[j].length); + var step = categories[j].length / displayLength; + for(var kk = 0; kk < displayLength; kk+=step) { + var k = Math.floor(kk*step) lineSerie.append(k * root.deltaTime, categories[j][k]) } } @@ -180,20 +184,25 @@ Item { var averageLine = cpuChart.createSeries(ChartView.SeriesTypeLine, "AVERAGE", valueCpuX, valueCpuY) var average = [] - for(var l = 0; l < categories[0].length; l++) { + var displayLengthA = Math.min(maxDisplayLength, categories[0].length); + var stepA = categories[0].length / displayLengthA; + for(var l = 0; l < displayLengthA; l+=step) { average.push(0) } for(var m = 0; m < categories.length; m++) { - for(var n = 0; n < categories[m].length; n++) { - average[n] += categories[m][n] + var displayLengthB = Math.min(maxDisplayLength, categories[m].length); + var stepB = categories[0].length / displayLengthB; + for(var nn = 0; nn < displayLengthB; nn++) { + var n = Math.floor(nn*stepB) + average[nn] += categories[m][n] } } for(var q = 0; q < average.length; q++) { average[q] = average[q] / (categories.length) - averageLine.append(q * root.deltaTime, average[q]) + averageLine.append(q * root.deltaTime * stepA, average[q]) } averageLine.color = colors[colors.length-1] @@ -231,14 +240,17 @@ Item { if(ram.length === 1) { // Create 2 entries if we have only one input value to create a segment that can be display - ramSerie.append(0, ram[0]) - ramSerie.append(root.deltaTime, ram[0]) + ramSerie.append(0, ram[0]); + ramSerie.append(root.deltaTime, ram[0]); } else { - for(var i = 0; i < ram.length; i++) { - ramSerie.append(i * root.deltaTime, ram[i]) + var displayLength = Math.min(maxDisplayLength, ram.length); + var step = ram.length / displayLength; + for(var ii = 0; ii < displayLength; ii++) { + var i = Math.floor(ii*step); + ramSerie.append(i * root.deltaTime, ram[i]); } } - ramSerie.color = colors[10] + ramSerie.color = colors[10]; } /************************** @@ -270,7 +282,10 @@ Item { gpuTemperatureSerie.append(1 * root.deltaTime, gpuTemperature[0]) root.gpuMaxAxis = Math.max(gpuMaxAxis, gpuTemperature[0]) } else { - for(var i = 0; i < gpuUsedMemory.length; i++) { + var displayLength = Math.min(maxDisplayLength, gpuUsedMemory.length); + var step = gpuUsedMemory.length / displayLength; + for(var ii = 0; ii < displayLength; ii+=step) { + var i = Math.floor(ii*step) gpuUsedSerie.append(i * root.deltaTime, gpuUsed[i]) gpuUsedMemorySerie.append(i * root.deltaTime, gpuUsedMemory[i] * gpuMemoryRatio) From dd099f3092b859d60e6ceb7766eacaa754ba69af Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 14 Dec 2020 15:06:09 +0100 Subject: [PATCH 06/24] [panorama] new method for large panoramas --- .../nodes/aliceVision/PanoramaCompositing.py | 36 +--------- meshroom/nodes/aliceVision/PanoramaSeams.py | 68 +++++++++++++++++++ 2 files changed, 71 insertions(+), 33 deletions(-) create mode 100644 meshroom/nodes/aliceVision/PanoramaSeams.py diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 8485e4fd55..ca52ad51aa 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -10,6 +10,7 @@ class PanoramaCompositing(desc.CommandLineNode): commandLine = 'aliceVision_panoramaCompositing {allParams}' size = desc.DynamicNodeSize('input') + parallelization = desc.Parallelization(blockSize=5) cpu = desc.Level.INTENSIVE ram = desc.Level.INTENSIVE @@ -35,16 +36,6 @@ class PanoramaCompositing(desc.CommandLineNode): 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], - group='', # not part of allParams, as this is not a parameter for the command line - ), desc.ChoiceParam( name='compositerType', label='Compositer Type', @@ -57,13 +48,6 @@ class PanoramaCompositing(desc.CommandLineNode): exclusive=True, uid=[0] ), - desc.BoolParam( - name='useGraphCut', - label='Use Smart Seams', - description='Use a graphcut algorithm to optmize seams for better transitions between images.', - value=True, - uid=[0], - ), desc.ChoiceParam( name='storageDataType', label='Storage Data Type', @@ -77,20 +61,6 @@ class PanoramaCompositing(desc.CommandLineNode): exclusive=True, uid=[0], ), - desc.ChoiceParam( - name='overlayType', - label='Overlay Type', - description='Overlay on top of panorama to analyze transitions:\n' - ' * none: no overlay\n' - ' * borders: display image borders\n' - ' * seams: display transitions between images\n' - ' * all: display borders and seams\n', - value='none', - values=['none', 'borders', 'seams', 'all'], - exclusive=True, - advanced=True, - uid=[0] - ), desc.File( name='customCacheFolder', label='Cache Folder', @@ -114,9 +84,9 @@ class PanoramaCompositing(desc.CommandLineNode): outputs = [ desc.File( name='output', - label='Output Panorama', + label='Output Folder', description='', - value=desc.Node.internalFolder + 'panorama.{outputFileTypeValue}', + value=desc.Node.internalFolder, uid=[], ), desc.File( diff --git a/meshroom/nodes/aliceVision/PanoramaSeams.py b/meshroom/nodes/aliceVision/PanoramaSeams.py new file mode 100644 index 0000000000..5ada2ad37a --- /dev/null +++ b/meshroom/nodes/aliceVision/PanoramaSeams.py @@ -0,0 +1,68 @@ +__version__ = "1.0" + +import json +import os + +from meshroom.core import desc + + +class PanoramaSeams(desc.CommandLineNode): + commandLine = 'aliceVision_panoramaSeams {allParams}' + size = desc.DynamicNodeSize('input') + + cpu = desc.Level.INTENSIVE + ram = desc.Level.INTENSIVE + + documentation = ''' +Estimate the seams lines between the inputs to provide an optimal compositing in a further node +''' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description="Input SfMData.", + value='', + uid=[0], + ), + desc.File( + name='warpingFolder', + label='Warping Folder', + description="Panorama Warping results", + value='', + uid=[0], + ), + desc.BoolParam( + name='useGraphCut', + label='Use Smart Seams', + description='Use a graphcut algorithm to optmize seams for better transitions between images.', + value=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=[], + ), + desc.File( + name='cacheFolder', + label='Cache Folder', + description='Temporary cache directory', + value="", + uid=[], + ) + ] + + outputs = [ + desc.File( + name='output', + label='Output Labels', + description='', + value=desc.Node.internalFolder + 'labels.exr', + uid=[], + ) + ] From be0a76f75acc86bf21b7d0da2f21055328f7535c Mon Sep 17 00:00:00 2001 From: Fabien Date: Tue, 15 Dec 2020 14:01:09 +0100 Subject: [PATCH 07/24] [panorama] error in compositing parrallelization --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index ca52ad51aa..0695b3dc5b 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -11,6 +11,8 @@ class PanoramaCompositing(desc.CommandLineNode): size = desc.DynamicNodeSize('input') parallelization = desc.Parallelization(blockSize=5) + commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}' + cpu = desc.Level.INTENSIVE ram = desc.Level.INTENSIVE From 7c4d6a9da8414eb22d5dd31f36af9612d0b09b8c Mon Sep 17 00:00:00 2001 From: Fabien Date: Thu, 17 Dec 2020 13:16:56 +0100 Subject: [PATCH 08/24] [panorama] replace rangeStart with rangeIteration --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 0695b3dc5b..11c8d7dc8b 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -11,7 +11,7 @@ class PanoramaCompositing(desc.CommandLineNode): size = desc.DynamicNodeSize('input') parallelization = desc.Parallelization(blockSize=5) - commandLineRange = '--rangeStart {rangeStart} --rangeSize {rangeBlockSize}' + commandLineRange = '--rangeIteration {rangeIteration} --rangeSize {rangeBlockSize}' cpu = desc.Level.INTENSIVE ram = desc.Level.INTENSIVE From 0520b1723a19e54a2d5e3dfb1c85b856ec403177 Mon Sep 17 00:00:00 2001 From: Fabien Date: Thu, 17 Dec 2020 16:26:53 +0100 Subject: [PATCH 09/24] [panorama] add Panorama Merging node --- .../nodes/aliceVision/PanoramaCompositing.py | 18 +---- meshroom/nodes/aliceVision/PanoramaMerging.py | 75 +++++++++++++++++++ 2 files changed, 76 insertions(+), 17 deletions(-) create mode 100644 meshroom/nodes/aliceVision/PanoramaMerging.py diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 11c8d7dc8b..a7f284b4d3 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -63,15 +63,6 @@ class PanoramaCompositing(desc.CommandLineNode): exclusive=True, uid=[0], ), - desc.File( - name='customCacheFolder', - label='Cache Folder', - description="Temporary cache directory", - value='', - uid=[0], - group='', - advanced=True, - ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', @@ -90,12 +81,5 @@ class PanoramaCompositing(desc.CommandLineNode): description='', value=desc.Node.internalFolder, uid=[], - ), - desc.File( - name='cacheFolder', - label='Cache Folder', - description='Temporary cache directory', - value=lambda attr: attr.node.customCacheFolder.value if attr.node.customCacheFolder.value else (desc.Node.internalFolder + 'cache/'), - uid=[], - ), + ) ] diff --git a/meshroom/nodes/aliceVision/PanoramaMerging.py b/meshroom/nodes/aliceVision/PanoramaMerging.py new file mode 100644 index 0000000000..4be405dda7 --- /dev/null +++ b/meshroom/nodes/aliceVision/PanoramaMerging.py @@ -0,0 +1,75 @@ +__version__ = "1.0" + +import json +import os + +from meshroom.core import desc + + +class PanoramaMerging(desc.CommandLineNode): + commandLine = 'aliceVision_panoramaMerging {allParams}' + size = desc.DynamicNodeSize('input') + + + documentation = ''' +Merge all inputs coming from PanoramaComposiring +''' + + inputs = [ + desc.File( + name='input', + label='Input SfMData', + description="Input SfMData.", + value='', + uid=[0], + ), + desc.File( + name='compositingFolder', + label='compositing Folder', + description="Panorama Compositing results", + 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], + group='', # not part of allParams, as this is not a parameter for the command line + ), + desc.ChoiceParam( + name='storageDataType', + label='Storage Data Type', + description='Storage image data type:\n' + ' * float: Use full floating point (32 bits per channel)\n' + ' * half: Use half float (16 bits per channel)\n' + ' * halfFinite: Use half float, but clamp values to avoid non-finite values\n' + ' * auto: Use half float if all values can fit, else use full float\n', + value='float', + values=['float', 'half', 'halfFinite', 'auto'], + 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='outputPanorama', + label='Output Folder', + description='', + value=desc.Node.internalFolder + 'panorama.{outputFileTypeValue}', + uid=[], + ), + ] From 63d5e9eadf402d88b4d72c440fb64be83d60f366 Mon Sep 17 00:00:00 2001 From: Fabien Date: Fri, 18 Dec 2020 11:19:41 +0100 Subject: [PATCH 10/24] [panorama] enable panorama compositing multi threading --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index a7f284b4d3..e811b7eb9b 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -50,6 +50,15 @@ class PanoramaCompositing(desc.CommandLineNode): exclusive=True, uid=[0] ), + desc.IntParam( + name='maxThreads', + label='Max Nb Threads', + description='Specifies the maximum number of threads to run simultaneously.', + value=1, + range=(1, 48, 1), + uid=[], + advanced=True, + ), desc.ChoiceParam( name='storageDataType', label='Storage Data Type', From 44ba3a1de079dd2e17ee0c7f848e15e6b4215435 Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 11 Jan 2021 11:37:49 +0100 Subject: [PATCH 11/24] [panorama] flag for graphcut --- meshroom/nodes/aliceVision/PanoramaSeams.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/meshroom/nodes/aliceVision/PanoramaSeams.py b/meshroom/nodes/aliceVision/PanoramaSeams.py index 5ada2ad37a..a890a584d7 100644 --- a/meshroom/nodes/aliceVision/PanoramaSeams.py +++ b/meshroom/nodes/aliceVision/PanoramaSeams.py @@ -47,13 +47,6 @@ class PanoramaSeams(desc.CommandLineNode): values=['fatal', 'error', 'warning', 'info', 'debug', 'trace'], exclusive=True, uid=[], - ), - desc.File( - name='cacheFolder', - label='Cache Folder', - description='Temporary cache directory', - value="", - uid=[], ) ] From b9876e6d9b7203ad8d5b5686a05ad95c608d4a90 Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 11 Jan 2021 12:15:11 +0100 Subject: [PATCH 12/24] [panoramaCompositing] add label image field --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index e811b7eb9b..14cd8deaa0 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -38,6 +38,13 @@ class PanoramaCompositing(desc.CommandLineNode): value='', uid=[0], ), + desc.File( + name='labels', + label='Labels image', + description="Panorama Seams results", + value='', + uid=[0], + ), desc.ChoiceParam( name='compositerType', label='Compositer Type', From a1afd045f6e1f8b502dfc7019179e2887a0dd784 Mon Sep 17 00:00:00 2001 From: Fabien Date: Mon, 11 Jan 2021 12:15:28 +0100 Subject: [PATCH 13/24] [panorama] update default pipeline for new items --- meshroom/multiview.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/meshroom/multiview.py b/meshroom/multiview.py index 776338e20b..d434dc4734 100644 --- a/meshroom/multiview.py +++ b/meshroom/multiview.py @@ -252,15 +252,33 @@ def panoramaHdrPipeline(graph): input=panoramaEstimation.output, method='from_single_camera') + panoramaWarpingSeams = graph.addNewNode('PanoramaWarping', + input=panoramaOrientation.output, + estimateResolution=False, + panoramaWidth=3000) + + panoramaSeams = graph.addNewNode('PanoramaSeams', + input=panoramaWarpingSeams.input, + warpingFolder=panoramaWarpingSeams.output + ) + panoramaWarping = graph.addNewNode('PanoramaWarping', input=panoramaOrientation.output) + panoramaCompositing = graph.addNewNode('PanoramaCompositing', input=panoramaWarping.input, - warpingFolder=panoramaWarping.output) + warpingFolder=panoramaWarping.output, + labels=panoramaSeams.output + ) + + panoramaMerging = graph.addNewNode('PanoramaMerging', + input=panoramaCompositing.input, + compositingFolder=panoramaCompositing.output + ) imageProcessing = graph.addNewNode('ImageProcessing', - input=panoramaCompositing.output, + input=panoramaMerging.outputPanorama, fixNonFinite=True, fillHoles=True, extension='exr') @@ -274,7 +292,10 @@ def panoramaHdrPipeline(graph): panoramaEstimation, panoramaOrientation, panoramaWarping, + panoramaWarpingSeams, + panoramaSeams, panoramaCompositing, + panoramaMerging, imageProcessing, ] From c416bf183957dddafc5010c52e617f6ed4dfa521 Mon Sep 17 00:00:00 2001 From: Fabien Date: Tue, 19 Jan 2021 11:28:47 +0100 Subject: [PATCH 14/24] [panorama] add debug capacities --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 14cd8deaa0..0d907bca4a 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -79,6 +79,20 @@ class PanoramaCompositing(desc.CommandLineNode): exclusive=True, uid=[0], ), + desc.ChoiceParam( + name='overlayType', + label='Overlay Type', + description='Overlay on top of panorama to analyze transitions:\n' + ' * none: no overlay\n' + ' * borders: display image borders\n' + ' * seams: display transitions between images\n' + ' * all: display borders and seams\n', + value='none', + values=['none', 'borders', 'seams', 'all'], + exclusive=True, + advanced=True, + uid=[0] + ), desc.ChoiceParam( name='verboseLevel', label='Verbose Level', From d9a69b8a2f5893999f5ef19ed5271feea6b22d15 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 26 Jan 2021 19:14:12 +0100 Subject: [PATCH 15/24] [nodes] PanoramaSeams: new maxWidth parameter --- meshroom/nodes/aliceVision/PanoramaSeams.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaSeams.py b/meshroom/nodes/aliceVision/PanoramaSeams.py index a890a584d7..389c0eb408 100644 --- a/meshroom/nodes/aliceVision/PanoramaSeams.py +++ b/meshroom/nodes/aliceVision/PanoramaSeams.py @@ -32,6 +32,14 @@ class PanoramaSeams(desc.CommandLineNode): value='', uid=[0], ), + desc.IntParam( + name='maxWidth', + label='Max Resolution', + description='Maximal resolution for the panorama seams estimation.', + value=5000, + range=(0, 100000, 1), + uid=[0], + ), desc.BoolParam( name='useGraphCut', label='Use Smart Seams', From 5b8f597bb6d6acfd158b135e5387ba2f06149510 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Tue, 26 Jan 2021 19:14:58 +0100 Subject: [PATCH 16/24] [multiview] use a linear pipeline for panorama with a single warp node --- meshroom/multiview.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/meshroom/multiview.py b/meshroom/multiview.py index d434dc4734..50e409c433 100644 --- a/meshroom/multiview.py +++ b/meshroom/multiview.py @@ -252,23 +252,17 @@ def panoramaHdrPipeline(graph): input=panoramaEstimation.output, method='from_single_camera') - panoramaWarpingSeams = graph.addNewNode('PanoramaWarping', - input=panoramaOrientation.output, - estimateResolution=False, - panoramaWidth=3000) - - panoramaSeams = graph.addNewNode('PanoramaSeams', - input=panoramaWarpingSeams.input, - warpingFolder=panoramaWarpingSeams.output - ) - panoramaWarping = graph.addNewNode('PanoramaWarping', input=panoramaOrientation.output) + panoramaSeams = graph.addNewNode('PanoramaSeams', + input=panoramaWarping.input, + warpingFolder=panoramaWarping.output + ) panoramaCompositing = graph.addNewNode('PanoramaCompositing', - input=panoramaWarping.input, - warpingFolder=panoramaWarping.output, + input=panoramaSeams.input, + warpingFolder=panoramaSeams.warpingFolder, labels=panoramaSeams.output ) @@ -292,7 +286,6 @@ def panoramaHdrPipeline(graph): panoramaEstimation, panoramaOrientation, panoramaWarping, - panoramaWarpingSeams, panoramaSeams, panoramaCompositing, panoramaMerging, From 7c4067f0799bdd82a79a3e5eaef9562c3786ee56 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 27 Jan 2021 14:17:38 +0100 Subject: [PATCH 17/24] [nodes] remove non-ascii --- meshroom/nodes/aliceVision/PanoramaInit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/PanoramaInit.py b/meshroom/nodes/aliceVision/PanoramaInit.py index c95fe6ff04..458cb82d19 100644 --- a/meshroom/nodes/aliceVision/PanoramaInit.py +++ b/meshroom/nodes/aliceVision/PanoramaInit.py @@ -63,7 +63,7 @@ class PanoramaInit(desc.CommandLineNode): ), name='nbViewsPerLine', label='Spherical: Nb Views Per Line', - description='Number of views per line in Spherical acquisition. Assumes angles from [-90°,+90°] for pitch and [-180°,+180°] for yaw. Use -1 to estimate the number of images automatically.', + description='Number of views per line in Spherical acquisition. Assumes angles from [-90,+90deg] for pitch and [-180,+180deg] for yaw. Use -1 to estimate the number of images automatically.', joinChar=',', enabled=lambda node: node.initializeCameras.value == 'Spherical', ), From 2e6a4fc3ec6703be5b395eb4c0a3a5efb2c6d29a Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 27 Jan 2021 14:18:10 +0100 Subject: [PATCH 18/24] [nodes] PanoramaCompositing: maxThread to 0 by default --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index 0d907bca4a..d6d743a421 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -12,7 +12,7 @@ class PanoramaCompositing(desc.CommandLineNode): parallelization = desc.Parallelization(blockSize=5) commandLineRange = '--rangeIteration {rangeIteration} --rangeSize {rangeBlockSize}' - + cpu = desc.Level.INTENSIVE ram = desc.Level.INTENSIVE @@ -61,8 +61,8 @@ class PanoramaCompositing(desc.CommandLineNode): name='maxThreads', label='Max Nb Threads', description='Specifies the maximum number of threads to run simultaneously.', - value=1, - range=(1, 48, 1), + value=0, + range=(0, 48, 1), uid=[], advanced=True, ), From 37851ec94cf84a80fd58cca6d4d57bbf16a3d8a7 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 27 Jan 2021 14:18:30 +0100 Subject: [PATCH 19/24] [nodes] PanoramaMerging: add ram requirements --- meshroom/nodes/aliceVision/PanoramaMerging.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meshroom/nodes/aliceVision/PanoramaMerging.py b/meshroom/nodes/aliceVision/PanoramaMerging.py index 4be405dda7..72ed3b7ed6 100644 --- a/meshroom/nodes/aliceVision/PanoramaMerging.py +++ b/meshroom/nodes/aliceVision/PanoramaMerging.py @@ -10,6 +10,9 @@ class PanoramaMerging(desc.CommandLineNode): commandLine = 'aliceVision_panoramaMerging {allParams}' size = desc.DynamicNodeSize('input') + cpu = desc.Level.NORMAL + ram = desc.Level.INTENSIVE + documentation = ''' Merge all inputs coming from PanoramaComposiring From d4c015c7cd32fa4e57c311345840df0f1b2fe0bb Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Wed, 27 Jan 2021 14:19:16 +0100 Subject: [PATCH 20/24] [nodes] PanoramaWarping: change maxPanoramaWidth to 70k --- meshroom/nodes/aliceVision/PanoramaWarping.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/PanoramaWarping.py b/meshroom/nodes/aliceVision/PanoramaWarping.py index 37642eacfb..de25238b75 100644 --- a/meshroom/nodes/aliceVision/PanoramaWarping.py +++ b/meshroom/nodes/aliceVision/PanoramaWarping.py @@ -60,7 +60,7 @@ class PanoramaWarping(desc.CommandLineNode): name='maxPanoramaWidth', label='Max Panorama Width', description='Choose the maximal output panorama width (in pixels). Zero means no limit.', - value=35000, + value=70000, range=(0, 100000, 1000), uid=[0], enabled=lambda node: (node.estimateResolution.value), From 2804cfe6d7eee32fac663a32c80309fb90aad201 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 28 Jan 2021 13:08:34 +0100 Subject: [PATCH 21/24] [nodes] PanoramaCompositing: limit max nb threads --- meshroom/nodes/aliceVision/PanoramaCompositing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/PanoramaCompositing.py b/meshroom/nodes/aliceVision/PanoramaCompositing.py index d6d743a421..e5270c6646 100644 --- a/meshroom/nodes/aliceVision/PanoramaCompositing.py +++ b/meshroom/nodes/aliceVision/PanoramaCompositing.py @@ -61,7 +61,7 @@ class PanoramaCompositing(desc.CommandLineNode): name='maxThreads', label='Max Nb Threads', description='Specifies the maximum number of threads to run simultaneously.', - value=0, + value=4, range=(0, 48, 1), uid=[], advanced=True, From 9304919c954694b71370f9441bebdde7295333c3 Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 28 Jan 2021 13:08:59 +0100 Subject: [PATCH 22/24] [nodes] LdrToHdrMerge: disable highlight corrections --- meshroom/nodes/aliceVision/LdrToHdrMerge.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meshroom/nodes/aliceVision/LdrToHdrMerge.py b/meshroom/nodes/aliceVision/LdrToHdrMerge.py index e1b1c88cfb..b22a25650e 100644 --- a/meshroom/nodes/aliceVision/LdrToHdrMerge.py +++ b/meshroom/nodes/aliceVision/LdrToHdrMerge.py @@ -108,7 +108,7 @@ class LdrToHdrMerge(desc.CommandLineNode): name='enableHighlight', label='Enable Highlight', description="Enable highlights correction.", - value=True, + value=False, uid=[0], group='user', # not used directly on the command line enabled= lambda node: node.byPass.enabled and not node.byPass.value, From 5e7b044d13ba43c8f3320220576bd5622c69723d Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 28 Jan 2021 19:44:44 +0100 Subject: [PATCH 23/24] [core] fix StatusData inheritance --- meshroom/core/node.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 16d68884cd..170ea6914d 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -63,7 +63,8 @@ class StatusData(BaseObject): """ dateTimeFormatting = '%Y-%m-%d %H:%M:%S.%f' - def __init__(self, nodeName='', nodeType='', packageName='', packageVersion=''): + def __init__(self, nodeName='', nodeType='', packageName='', packageVersion='', parent=None): + super(StatusData, self).__init__(parent) self.status = Status.NONE self.execMode = ExecMode.NONE self.nodeName = nodeName @@ -113,6 +114,7 @@ def elapsedTimeStr(self): def toDict(self): d = self.__dict__.copy() + d.pop('destroyed', None) # skip non data attributes from BaseObject d["elapsedTimeStr"] = self.elapsedTimeStr return d @@ -161,7 +163,7 @@ def configureLogger(self): def start(self, level): # Clear log file open(self.chunk.logFile, 'w').close() - + self.configureLogger() self.logger.setLevel(self.textToLevel(level)) self.progressBar = False @@ -178,19 +180,19 @@ def makeProgressBar(self, end, message=''): self.progressEnd = end self.currentProgressTics = 0 self.progressBar = True - + with open(self.chunk.logFile, 'a') as f: if message: f.write(message+'\n') f.write('0% 10 20 30 40 50 60 70 80 90 100%\n') f.write('|----|----|----|----|----|----|----|----|----|----|\n\n') - + f.close() - + with open(self.chunk.logFile, 'r') as f: content = f.read() self.progressBarPosition = content.rfind('\n') - + f.close() def updateProgressBar(self, value): @@ -332,7 +334,7 @@ def saveStatusFile(self): os.makedirs(folder) except Exception as e: pass - + statusFilepathWriting = getWritingFilepath(statusFilepath) with open(statusFilepathWriting, 'w') as jsonFile: json.dump(data, jsonFile, indent=4) From 79e4a59e8ce48f334bdaa446b520ec61cd7d21ee Mon Sep 17 00:00:00 2001 From: Fabien Castan Date: Thu, 28 Jan 2021 19:56:25 +0100 Subject: [PATCH 24/24] [core] fix clearSubmittedChunks --- meshroom/core/node.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 170ea6914d..ae9b0d70cc 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -744,8 +744,8 @@ def clearSubmittedChunks(self): This must be used with caution. This could lead to inconsistent node status if the graph is still being computed. """ - for chunk in self.alreadySubmittedChunks(): - if not chunk.isExtern(): + for chunk in self._chunks: + if chunk.isAlreadySubmitted(): chunk.upgradeStatusTo(Status.NONE, ExecMode.NONE) def upgradeStatusTo(self, newStatus):