Skip to content

Commit

Permalink
Merge pull request #1967 from alicevision/dev/sfmDataKeyframeSelection
Browse files Browse the repository at this point in the history
[nodes] KeyframeSelection: Add support for SfMData files as inputs and outputs
  • Loading branch information
mugulmd authored Apr 26, 2023
2 parents ad9d549 + 903134f commit 11975e8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 9 deletions.
31 changes: 23 additions & 8 deletions meshroom/nodes/aliceVision/KeyframeSelection.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.0"
__version__ = "4.0"

import os
from meshroom.core import desc
Expand All @@ -18,15 +18,15 @@ class KeyframeSelection(desc.AVCommandLineNode):
inputs = [
desc.ListAttribute(
elementDesc=desc.File(
name="mediaPath",
label="Media Path",
description="Media path.",
name="inputPath",
label="Input Path",
description="Input path.",
value="",
uid=[0],
),
name="mediaPaths",
label="Media Paths",
description="Input video files or image sequence directories.",
name="inputPaths",
label="Input Paths",
description="Input video files, image sequence directories or SfMData file.",
),
desc.ListAttribute(
elementDesc=desc.File(
Expand Down Expand Up @@ -67,7 +67,7 @@ class KeyframeSelection(desc.AVCommandLineNode):
),
desc.File(
name="sensorDbPath",
label="Sensor Db Path",
label="Sensor Database",
description="Camera sensor width database path.",
value="${ALICEVISION_SENSOR_DB}",
uid=[0],
Expand Down Expand Up @@ -341,5 +341,20 @@ class KeyframeSelection(desc.AVCommandLineNode):
value=desc.Node.internalFolder,
uid=[],
),
desc.File(
name="outputSfMDataKeyframes",
label="Keyframes SfMData",
description="Output SfMData file containing all the selected keyframes.",
value=desc.Node.internalFolder + "keyframes.sfm",
uid=[],
),
desc.File(
name="outputSfMDataFrames",
label="Frames SfMData",
description="Output SfMData file containing all the frames that were not selected as keyframes.\n"
"If the input contains videos, this file will not be written since all the frames that were not selected do not actually exist on disk.",
value=desc.Node.internalFolder + "frames.sfm",
uid=[]
)
]

2 changes: 1 addition & 1 deletion meshroom/ui/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def handleFilesDrop(self, drop, cameraInit):
if filesByType.videos:
boundingBox = self.layout.boundingBox()
keyframeNode = self.addNewNode("KeyframeSelection", position=Position(boundingBox[0], boundingBox[1] + boundingBox[3]))
keyframeNode.mediaPaths.value = filesByType.videos
keyframeNode.inputPaths.value = filesByType.videos
if len(filesByType.videos) == 1:
newVideoNodeMessage = "New node '{}' added for the input video.".format(keyframeNode.getLabel())
else:
Expand Down

0 comments on commit 11975e8

Please sign in to comment.