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

Improve MaskOutput dimension consistency #7591

Merged
merged 3 commits into from
Jan 28, 2025
Merged

Conversation

RyanJDick
Copy link
Collaborator

Summary

This PR fixes an issue with mask dimension consistency. Prior to this change, the following workflow would fail with tuple out of range error:

image

Before this PR

Dimension compatibility for invocations that take a mask input:

  • ApplyMaskTensorToImageInvocation: 2 or 3
  • MaskTensorToImageInvocation: 2 or 3
  • InvertTensorMaskInvocation: 3

Mask dimension for invocations that produce a MaskOutput:

  • RectangleMaskInvocation: 3
  • AlphaMaskToTensorInvocation: 3
  • InvertTensorMaskInvocation: 3
  • ImageMaskToTensorInvocation: 3
  • SegmentAnythingInvocation: 2

After this PR (changes in bold)

Dimension compatibility for invocations that take a mask input:

  • ApplyMaskTensorToImageInvocation: 2 or 3
  • MaskTensorToImageInvocation: 2 or 3
  • InvertTensorMaskInvocation: 2 or 3 <----------------

Mask dimension for invocations that produce a MaskOutput:

  • RectangleMaskInvocation: 3
  • AlphaMaskToTensorInvocation: 3
  • InvertTensorMaskInvocation: 3
  • ImageMaskToTensorInvocation: 3
  • SegmentAnythingInvocation: 3 <-------------------

QA Instructions

I tested the workflow in the PR description and this workflow:
image

Merge Plan

No special instructions.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog
  • Tests added / updated (if applicable)
  • Documentation added / updated (if applicable)
  • Updated What's New copy (if doing a release after this PR)

…hannel dimension of size 1. This is the convention used by other nodes that produce a MaskOutput.
@github-actions github-actions bot added python PRs that change python files invocations PRs that change invocations labels Jan 24, 2025
Copy link
Collaborator

@psychedelicious psychedelicious left a comment

Choose a reason for hiding this comment

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

Thanks!

@hipsterusername
Copy link
Member

Typegen failing check

@RyanJDick RyanJDick requested a review from maryhipp as a code owner January 28, 2025 14:30
@github-actions github-actions bot added the frontend PRs that change frontend files label Jan 28, 2025
@RyanJDick RyanJDick merged commit 9d2f8b4 into main Jan 28, 2025
15 checks passed
@RyanJDick RyanJDick deleted the ryan/mask-dim-consistency branch January 28, 2025 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
frontend PRs that change frontend files invocations PRs that change invocations python PRs that change python files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants