fix: add null_class_id override to SemanticSegmentationLabelSource - #2329
Open
Pranava-Kumar wants to merge 1 commit into
Open
fix: add null_class_id override to SemanticSegmentationLabelSource#2329Pranava-Kumar wants to merge 1 commit into
Pranava-Kumar wants to merge 1 commit into
Conversation
Adds an optional null_class_id parameter to __init__ that overrides class_config.null_class_id. Falls back to class_config.null_class_id when not provided. Also fixes the outdated docstring that mentioned a null_class_id parameter that didn't exist in the signature. Closes azavea#2326.
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.
Summary
Fixes #2326 by adding an optional
null_class_idparameter toSemanticSegmentationLabelSource.__init__that overridesclass_config.null_class_id. Also fixes the outdated docstring that referenced anull_class_idparameter that didn't exist in the signature.Changes
semantic_segmentation_label_source.py: Addednull_class_id: int | None = Noneparameter to__init__. Exposed via anull_class_idproperty that falls back toclass_config.null_class_idwhen not set. Updatedget_label_arrto use the lazy property. Fixed docstring to accurately describe all parameters.test_semantic_segmentation_label_source.py: Added 3 tests — default behavior, explicit override, and override used for off-edge padding.Backward Compatibility
Fully backward compatible. When
null_class_idisNone(default), behavior is identical to the current implementation. The lazy property approach meansclass_config.null_class_idis only evaluated when actually needed (off-edge windows), preserving the original lazy evaluation pattern.Closes #2326.