Skip to content

Enable first frame processing only in VideoSegmentationSam3Text - #73

Open
demoulinv wants to merge 4 commits into
mainfrom
dev/videoSegmentationSam3TextSingleFrameProcessing
Open

Enable first frame processing only in VideoSegmentationSam3Text#73
demoulinv wants to merge 4 commits into
mainfrom
dev/videoSegmentationSam3TextSingleFrameProcessing

Conversation

@demoulinv

Copy link
Copy Markdown
Collaborator

This pull request updates the VideoSegmentationSam3Text node to add an option for processing only the first frame of a video, and ensures that related segmentation and propagation features are correctly disabled when this option is active. The changes improve the flexibility of the segmentation workflow and prevent conflicting parameter combinations.

Key changes:

New Feature: First Frame Only Processing

  • Added a new boolean parameter firstFrameOnly to allow segmentation to be run on only the first frame, without propagating to the rest of the sequence.

Conditional Parameter Enablement

  • Updated the combineFwdAndBwdSeg, timeSlicing, and sliceSize parameters to be disabled when firstFrameOnly is enabled, preventing users from selecting incompatible options.
  • Adjusted the enablement logic for the outputColorMasks parameter, so it is only enabled if firstFrameOnly is not active.

Processing Logic Adjustments

  • Modified the tracking configuration and mask export logic to respect the firstFrameOnly setting, ensuring that time slicing and combined segmentation are not performed when only the first frame is processed.
  • Updated the image path resolution to process only the first image when firstFrameOnly is set.
  • Ensured that forward and backward combination is disabled in the chunk processing logic if firstFrameOnly is enabled.

Version Update

  • Bumped the module version from 2.1 to 2.2 to reflect the new feature.

@demoulinv
demoulinv requested a balanced review from Copilot August 25, 2026 12:48
@demoulinv demoulinv self-assigned this Aug 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds first-frame-only segmentation to the SAM3 text video node.

Changes:

  • Adds firstFrameOnly and conditional parameter enablement.
  • Limits processing and propagation to the first frame.
  • Bumps the module version to 2.2.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread meshroom/sam3/VideoSegmentationSam3Text.py Outdated
track_states=track_states,
color_palette=color_palette,
combine_fwd_bwd=chunk.node.combineFwdAndBwdSeg.value
combine_fwd_bwd=chunk.node.combineFwdAndBwdSeg.value and not chunk.node.firstFrameOnly.value
Comment on lines +512 to +515
if node.firstFrameOnly.value:
self.image_paths = [image_paths[0]]
else:
self.image_paths = image_paths
@demoulinv
demoulinv requested a review from cbentejac August 25, 2026 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants