Skip to content

Add SemanticSegmentation PascalVOC Support#48

Merged
MalteEbner merged 13 commits intomainfrom
malte-lig-8012-semanticsegmentation-support-in-labelformat
Nov 19, 2025
Merged

Add SemanticSegmentation PascalVOC Support#48
MalteEbner merged 13 commits intomainfrom
malte-lig-8012-semanticsegmentation-support-in-labelformat

Conversation

@MalteEbner
Copy link
Copy Markdown
Contributor

Description

Adds support for the PascalVOC semantic segmentation format. Current support is limited, see the TODOs.

Tests

Added unittests

Next steps

  • Keep the TODOs as they are now, we can implement them later once needed.
  • Update the documentation.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces support for the PascalVOC semantic segmentation format by adding a new input adapter that reads masks from PNG files and maps them to category labels.

Key Changes:

  • Created a new SemanticSegmentationInput abstract interface for semantic segmentation formats
  • Implemented PascalVOCSemanticSegmentationInput to load images and corresponding mask PNGs
  • Added comprehensive unit tests covering normal operation and error conditions

Reviewed Changes

Copilot reviewed 4 out of 8 changed files in this pull request and generated 2 comments.

File Description
src/labelformat/model/semantic_segmentation.py Defines the core interface and mask dataclass for semantic segmentation
src/labelformat/formats/semantic_segmentation/pascalvoc.py Implements PascalVOC format loading with validation
tests/unit/formats/semantic_segmentation/test_pascalvoc.py Unit tests for PascalVOC loader functionality
tests/fixtures/semantic_segmentation/pascalvoc/class_id_to_name.json Test fixture containing PascalVOC class ID to name mappings

Comment thread src/labelformat/formats/semantic_segmentation/pascalvoc.py
Comment thread src/labelformat/formats/semantic_segmentation/pascalvoc.py
Copy link
Copy Markdown
Contributor

@JonasWurst JonasWurst left a comment

Choose a reason for hiding this comment

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

Overall looks good, only the image_filepath needs some clarification

Comment thread src/labelformat/model/semantic_segmentation.py Outdated
Comment thread src/labelformat/model/semantic_segmentation.py Outdated
Comment thread src/labelformat/formats/semantic_segmentation/pascalvoc.py
Comment thread src/labelformat/formats/semantic_segmentation/pascalvoc.py Outdated
Comment thread src/labelformat/formats/semantic_segmentation/pascalvoc.py
Comment thread tests/unit/formats/semantic_segmentation/test_pascalvoc.py Outdated
Comment thread tests/unit/formats/semantic_segmentation/test_pascalvoc.py Outdated
Copy link
Copy Markdown
Contributor

@JonasWurst JonasWurst left a comment

Choose a reason for hiding this comment

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

LGTM

@MalteEbner MalteEbner merged commit f3b489c into main Nov 19, 2025
2 checks passed
@MalteEbner MalteEbner deleted the malte-lig-8012-semanticsegmentation-support-in-labelformat branch November 19, 2025 09:23
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.

3 participants