Add SemanticSegmentation PascalVOC Support#48
Merged
MalteEbner merged 13 commits intomainfrom Nov 19, 2025
Merged
Conversation
There was a problem hiding this comment.
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
SemanticSegmentationInputabstract interface for semantic segmentation formats - Implemented
PascalVOCSemanticSegmentationInputto 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 |
JonasWurst
reviewed
Nov 17, 2025
Contributor
JonasWurst
left a comment
There was a problem hiding this comment.
Overall looks good, only the image_filepath needs some clarification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds support for the PascalVOC semantic segmentation format. Current support is limited, see the TODOs.
Tests
Added unittests
Next steps