Conversation
FindingsNo correctness defect found in the change itself. The one-line removal is verified correct against the pinned dependency. Two coverage/accuracy issues remain.
|
|
PR #9588 addresses the same problem. Please compare. |
|
Is backwards compatibility with previous versions of transformers a gaurantee the rest of the code base makes? I would assume changing a pinned dependancy locally would cause more issues outside of SAM2. Tests should be needed regardless incase pinning a new transformers version in the code base causes the pipeline to break |
Summary
Fixes SAM2 segmentation when using the current Transformers SAM2 processor.
Sam2Processorno longer returnsreshaped_input_sizesin its processed inputs, but the InvokeAI SAM2 pipeline attempts to access that field during mask post-processingRemoving the obsolete argument allows SAM2 mask post-processing to complete successfully.
Processing an image with the SAM2 processor:
returns:
There is no
reshaped_input_sizesRelated Issues / Discussions
Closes #9551
QA Instructions
Tested locally with:
facebook/sam2.1-hiera-largeBefore the change, SAM2 segmentation consistently failed with
KeyError: 'reshaped_input_sizes'After the change, SAM2 segmentation completes successfully
Merge Plan
Checklist
What's Newcopy (if doing a release after this PR)