Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nodes] KeyframeSelection: Add support for SfMData files as inputs and outputs #1967

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions meshroom/nodes/aliceVision/KeyframeSelection.py
cbentejac marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could add a dynamic node size to the node using the size member variable: this would enable the chunk mechanism for the nodes after this one in a pipeline

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