Skip to content

Add mask-based visualization support to LLMAttributionResult.plot_image_heatmap#1757

Closed
aobo-y wants to merge 6 commits into
meta-pytorch:masterfrom
aobo-y:export-D90038941
Closed

Add mask-based visualization support to LLMAttributionResult.plot_image_heatmap#1757
aobo-y wants to merge 6 commits into
meta-pytorch:masterfrom
aobo-y:export-D90038941

Conversation

@aobo-y

@aobo-y aobo-y commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

Summary: Enable plot_image_heatmap to leverage the new draw_mask_border and draw_mask_legend utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941

@meta-cla meta-cla Bot added the cla signed label Jan 2, 2026
@meta-codesync

meta-codesync Bot commented Jan 2, 2026

Copy link
Copy Markdown
Contributor

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

aobo-y added 6 commits January 2, 2026 15:23
Summary:

add util to visualize how the image is segmented into features

Differential Revision: D89953376
Summary: as title

Differential Revision: D89954220
Summary:

as title

Reviewed By: styusuf

Differential Revision: D89954477
Summary:

Extract the mask list generation logic into a reusable method, centralizing the logic for creating binary masks from either mask_list or mask tensor

Reviewed By: sarahtranfb

Differential Revision: D90034703
…n module (meta-pytorch#1756)

Summary:

Extract border and legend drawing logic from `plot_mask_overlay` into reusable utility functions `draw_mask_border` and `draw_mask_legend` in the visualization

Differential Revision: D90036627
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 2, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 3, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 5, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Reviewed By: craymichael

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 5, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Reviewed By: craymichael

Differential Revision: D90038941
aobo-y added a commit to aobo-y/captum that referenced this pull request Jan 5, 2026
…ge_heatmap (meta-pytorch#1757)

Summary:

Enable `plot_image_heatmap` to leverage the new `draw_mask_border` and `draw_mask_legend` utilities when the input has mask segments. This provides better visualization for image attribution with discrete regions, displaying attribution colors per segment with borders and labels derived from the salience values.

Reviewed By: craymichael

Differential Revision: D90038941
@meta-codesync meta-codesync Bot closed this in 8264e2d Jan 5, 2026
@meta-codesync

meta-codesync Bot commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 8264e2d.

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