Skip to content

Commit

Permalink
Merge pull request #1776 from alicevision/dev/lv/adapt2DViewerToNode
Browse files Browse the repository at this point in the history
Show generated images in 2D viewer when double-clicking on node
  • Loading branch information
fabiencastan authored Oct 19, 2022
2 parents ab0e132 + 0424ae1 commit 1f78158
Show file tree
Hide file tree
Showing 45 changed files with 303 additions and 130 deletions.
8 changes: 8 additions & 0 deletions meshroom/core/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ def isRunning(self):
def isStopped(self):
return self._status.status == Status.STOPPED

def isFinished(self):
return self._status.status == Status.SUCCESS

def process(self, forceCompute=False):
if not forceCompute and self._status.status == Status.SUCCESS:
logging.info("Node chunk already computed: {}".format(self.name))
Expand Down Expand Up @@ -752,6 +755,11 @@ def isFinishedOrRunning(self):
""" Return True if all chunks of this Node is either finished or running, False otherwise. """
return all(chunk.isFinishedOrRunning() for chunk in self._chunks)

@Slot(result=bool)
def isPartiallyFinished(self):
""" Return True is at least one chunk of this Node is finished, False otherwise. """
return any(chunk.isFinished() for chunk in self._chunks)

def alreadySubmittedChunks(self):
return [ch for ch in self._chunks if ch.isAlreadySubmitted()]

Expand Down
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/CameraLocalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ class CameraLocalization(desc.CommandLineNode):
outputs = [
desc.File(
name='outputAlembic',
label='Output Alembic',
label='Alembic',
description='''Filename for the SfMData export file (where camera poses will be stored)''',
value=desc.Node.internalFolder + 'trackedCameras.abc',
uid=[],
),
desc.File(
name='outputJSON',
label='Output JSON',
label='JSON',
description='''Filename for the localization results as .json''',
value=desc.Node.internalFolder + 'trackedCameras.json',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/CameraRigCalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class CameraRigCalibration(desc.CommandLineNode):
outputs = [
desc.File(
name='outfile',
label='Output File',
label='File',
description='''The name of the file where to store the calibration data''',
value=desc.Node.internalFolder + 'cameraRigCalibration.rigCal',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/CameraRigLocalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class CameraRigLocalization(desc.CommandLineNode):
outputs = [
desc.File(
name='outputAlembic',
label='Output Alembic',
label='Alembic',
description='''Filename for the SfMData export file (where camera poses will be stored).''',
value=desc.Node.internalFolder + 'trackedcameras.abc',
uid=[],
Expand Down
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/ColorCheckerCorrection.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ class ColorCheckerCorrection(desc.CommandLineNode):
outputs = [
desc.File(
name='outSfMData',
label='Output sfmData',
label='SfmData',
description='Output sfmData.',
value=lambda attr: (desc.Node.internalFolder + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in ['.abc', '.sfm']) else '',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Output Images Folder.',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/ConvertMesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class ConvertMesh(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Mesh',
label='Mesh',
description='''Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).''',
value=desc.Node.internalFolder + 'mesh.' + '{outputMeshFileTypeValue}',
uid=[],
Expand Down
23 changes: 22 additions & 1 deletion meshroom/nodes/aliceVision/DepthMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,30 @@ class DepthMap(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output',
label='Folder',
description='Output folder for generated depth maps.',
value=desc.Node.internalFolder,
uid=[],
),
# these attributes are only here to describe more accurately the output of the node
# by specifying that it generates 2 sequences of images
# (see in Viewer2D.qml how these attributes can be used)
desc.File(
name='depth',
label='Depth Maps',
description='Generated depth maps.',
semantic='image',
value=desc.Node.internalFolder + '<VIEW_ID>_depthMap.exr',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='sim',
label='Sim Maps',
description='Generated sim maps.',
semantic='image',
value=desc.Node.internalFolder + '<VIEW_ID>_simMap.exr',
uid=[],
group='', # do not export on the command line
),
]
21 changes: 21 additions & 0 deletions meshroom/nodes/aliceVision/DepthMapFilter.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,25 @@ class DepthMapFilter(desc.CommandLineNode):
value=desc.Node.internalFolder,
uid=[],
),
# these attributes are only here to describe more accurately the output of the node
# by specifying that it generates 2 sequences of images
# (see in Viewer2D.qml how these attributes can be used)
desc.File(
name='depth',
label='Depth Maps',
description='Filtered depth maps.',
semantic='image',
value=desc.Node.internalFolder + '<VIEW_ID>_depthMap.exr',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='sim',
label='Sim Maps',
description='Filtered sim maps.',
semantic='image',
value=desc.Node.internalFolder + '<VIEW_ID>_simMap.exr',
uid=[],
group='', # do not export on the command line
),
]
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/DistortionCalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class DistortionCalibration(desc.CommandLineNode):
outputs = [
desc.File(
name='outSfMData',
label='Output SfmData File',
label='SfmData File',
description='Path to the output sfmData file',
value=desc.Node.internalFolder + 'sfmData.sfm',
uid=[],
Expand Down
6 changes: 3 additions & 3 deletions meshroom/nodes/aliceVision/ExportAnimatedCamera.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@ class ExportAnimatedCamera(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output filepath',
label='Filepath',
description='Output filepath for the alembic animated camera.',
value=desc.Node.internalFolder,
uid=[],
),
desc.File(
name='outputCamera',
label='Output Camera Filepath',
label='Camera Filepath',
description='Output filename for the alembic animated camera.',
value=desc.Node.internalFolder + 'camera.abc',
group='', # exclude from command line
uid=[],
),
desc.File(
name='outputUndistorted',
label='Output Undistorted images Filepath',
label='Undistorted images Filepath',
description='Output Undistorted images.',
value=desc.Node.internalFolder + 'undistort',
group='', # exclude from command line
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/ExportColoredPointCloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ExportColoredPointCloud(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Point Cloud Filepath',
label='Point Cloud Filepath',
description='Output point cloud with visibilities as SfMData file.',
value="{cache}/{nodeType}/{uid0}/pointCloud.abc",
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/ExportMatches.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class ExportMatches(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Output path for the features and descriptors files (*.feat, *.desc).',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/ExportMaya.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ExportMaya(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Folder for MeshroomMaya outputs: undistorted images and thumbnails.',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/FeatureRepeatability.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class FeatureRepeatability(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Output path for the features and descriptors files (*.feat, *.desc).',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/GlobalSfM.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class GlobalSfM(desc.CommandLineNode):
),
desc.File(
name='extraInfoFolder',
label='Output Folder',
label='Folder',
description='Folder for intermediate reconstruction files and additional reconstruction information files.',
value=desc.Node.internalFolder,
uid=[],
Expand Down
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/ImageMatchingMultiSfM.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,14 @@ class ImageMatchingMultiSfM(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output List File',
label='List File',
description='Filepath to the output file with the list of selected image pairs.',
value=desc.Node.internalFolder + 'imageMatches.txt',
uid=[],
),
desc.File(
name='outputCombinedSfM',
label='Output Combined SfM',
label='Combined SfM',
description='Path for the combined SfMData file',
value=desc.Node.internalFolder + 'combineSfM.sfm',
uid=[],
Expand Down
9 changes: 5 additions & 4 deletions meshroom/nodes/aliceVision/ImageProcessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def outputImagesValueFunct(attr):

if inputExt in ['.abc', '.sfm']:
# If we have an SfM in input
return desc.Node.internalFolder + '*' + (outputExt or '.*')
return desc.Node.internalFolder + '<VIEW_ID>' + (outputExt or '.*')

if inputExt:
# if we have one or multiple files in input
Expand Down Expand Up @@ -325,23 +325,24 @@ class ImageProcessing(desc.CommandLineNode):
outputs = [
desc.File(
name='outSfMData',
label='Output sfmData',
label='SfmData',
description='Output sfmData.',
value=lambda attr: (desc.Node.internalFolder + os.path.basename(attr.node.input.value)) if (os.path.splitext(attr.node.input.value)[1] in ['.abc', '.sfm']) else '',
uid=[],
group='', # do not export on the command line
),
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Output Images Folder.',
value=desc.Node.internalFolder,
uid=[],
),
desc.File(
name='outputImages',
label='Output Images',
label='Images',
description='Output Image Files.',
semantic='image',
value= outputImagesValueFunct,
group='', # do not export on the command line
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/KeyframeSelection.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ class KeyframeSelection(desc.CommandLineNode):
outputs = [
desc.File(
name='outputFolder',
label='Output Folder',
label='Folder',
description='''Output keyframes folder for extracted frames.''',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/LdrToHdrCalibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class LdrToHdrCalibration(desc.CommandLineNode):
outputs = [
desc.File(
name='response',
label='Output response File',
label='Response File',
description='Path to the output response file',
value=desc.Node.internalFolder + 'response.csv',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/LdrToHdrMerge.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class LdrToHdrMerge(desc.CommandLineNode):
outputs = [
desc.File(
name='outSfMData',
label='Output SfMData File',
label='SfMData File',
description='Path to the output sfmdata file',
value=desc.Node.internalFolder + 'sfmData.sfm',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/LdrToHdrSampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class LdrToHdrSampling(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Output path for the samples.',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/LightingEstimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class LightingEstimation(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='Folder for output lighting vector files.',
value=desc.Node.internalFolder,
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/MergeMeshes.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class MergeMeshes(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output mesh',
label='Mesh',
description='''Output mesh (*.obj, *.mesh, *.meshb, *.ply, *.off, *.stl).''',
value=desc.Node.internalFolder + 'mesh.stl',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/MeshDecimate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class MeshDecimate(desc.CommandLineNode):
outputs = [
desc.File(
name="output",
label="Output mesh",
label="Mesh",
description="Output mesh (OBJ file format).",
value=desc.Node.internalFolder + 'mesh.obj',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/MeshMasking.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class MeshMasking(desc.CommandLineNode):
outputs = [
desc.File(
name='outputMesh',
label='Output Mesh',
label='Mesh',
description='''Output mesh.''',
value=desc.Node.internalFolder + 'mesh.{outputMeshFileTypeValue}',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/MeshResampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MeshResampling(desc.CommandLineNode):
outputs = [
desc.File(
name="output",
label="Output mesh",
label="Mesh",
description="Output mesh (OBJ file format).",
value=desc.Node.internalFolder + 'mesh.obj',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/PanoramaCompositing.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class PanoramaCompositing(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output Folder',
label='Folder',
description='',
value=desc.Node.internalFolder,
uid=[],
Expand Down
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/PanoramaEstimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,14 @@ class PanoramaEstimation(desc.CommandLineNode):
outputs = [
desc.File(
name='output',
label='Output SfMData File',
label='SfMData File',
description='Path to the output sfmdata file',
value=desc.Node.internalFolder + 'panorama.abc',
uid=[],
),
desc.File(
name='outputViewsAndPoses',
label='Output Poses',
label='Poses',
description='''Path to the output sfmdata file with cameras (views and poses).''',
value=desc.Node.internalFolder + 'cameras.sfm',
uid=[],
Expand Down
2 changes: 1 addition & 1 deletion meshroom/nodes/aliceVision/PanoramaInit.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class PanoramaInit(desc.CommandLineNode):
outputs = [
desc.File(
name='outSfMData',
label='Output SfMData File',
label='SfMData File',
description='Path to the output sfmdata file',
value=desc.Node.internalFolder + 'sfmData.sfm',
uid=[],
Expand Down
Loading

0 comments on commit 1f78158

Please sign in to comment.