Skip to content

Fix mask resizing in the semantic segmentation guide - #8843

Open
jinchuntan wants to merge 1 commit into
huggingface:mainfrom
jinchuntan:docs/segmentation-mask-resize
Open

jinchuntan wants to merge 1 commit into
huggingface:mainfrom
jinchuntan:docs/segmentation-mask-resize

Conversation

@jinchuntan

@jinchuntan jinchuntan commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

The Torchvision example now resizes masks with nearest neighbor interpolation so it doesn't create new class labels. I also removed the old output image, which shows the incorrect mask boundaries. Fixes #6865.

Checked the updated example with upscaling and downscaling, for single examples and batches. Class labels are preserved and make quality passes.

Use nearest-neighbor interpolation for masks so resizing preserves class labels. Remove the old illustration showing blended mask boundaries.

Fixes huggingface#6865

Assisted-by: Codex
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.

Example on Semantic segmentation contains bug

1 participant