Skip to content

Add util to viz mask segmentations in ImageMaskInput#1752

Closed
aobo-y wants to merge 4 commits into
meta-pytorch:masterfrom
aobo-y:export-D89953376
Closed

Add util to viz mask segmentations in ImageMaskInput#1752
aobo-y wants to merge 4 commits into
meta-pytorch:masterfrom
aobo-y:export-D89953376

Conversation

@aobo-y
Copy link
Copy Markdown
Contributor

@aobo-y aobo-y commented Dec 31, 2025

Summary: add util to visualize how the image is segmented into features

Differential Revision: D89953376

Summary:

Add a new `mask_list` argument to `ImageMaskInput` that allows defining overlapping features on the same pixel. Unlike `mask` where each pixel belongs to exactly one feature, `mask_list` accepts a list of binary masks where each mask indicates one feature. This enables more flexible image segmentation for attribution analysis
- Added `mask_list` parameter that takes precedence over `mask` when provided
- Updated `to_model_input` to handle both `mask_list` and `mask` modes
- Updated `format_pixel_attr` to sum attributions from overlapping features when using `mask_list`

(sum attr is not the best choice to represent overlapped pixels, up to change later)

Differential Revision: D89949211
Summary:

as title

Differential Revision: D89952326
Summary: add util to visualize how the image is segmented into features

Differential Revision: D89953376
@meta-cla meta-cla Bot added the cla signed label Dec 31, 2025
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Dec 31, 2025

@aobo-y has exported this pull request. If you are a Meta employee, you can view the originating Diff in D89953376.

aobo-y added a commit to aobo-y/captum that referenced this pull request Dec 31, 2025
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Dec 31, 2025
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Dec 31, 2025
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
@meta-codesync meta-codesync Bot closed this in ae0d20c Jan 3, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Jan 3, 2026

This pull request has been merged in ae0d20c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants