-
-
Notifications
You must be signed in to change notification settings - Fork 46
more robust ignore label support #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
There was a problem hiding this 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 adds support for configurable ignore label values across the training pipeline. It enables users to specify labels that should be treated as background during patch validation, loss computation, metrics evaluation, and skeleton transform processing.
Key changes:
- Added
zero_ignore_labelsutility function to handle ignore label zeroing in patch validation - Extended loss configuration, metrics initialization, and transforms to accept and use ignore values via aliases (
ignore_index,ignore_label,ignore_value) - Updated dependency versions in
pyproject.toml
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| vesuvius/src/vesuvius/models/datasets/find_valid_patches.py | Added zero_ignore_labels function and integrated ignore label handling into patch validation logic |
| vesuvius/src/vesuvius/models/datasets/slicers/chunk.py | Updated chunk slicer to propagate ignore values through the validation pipeline |
| vesuvius/src/vesuvius/models/datasets/base_dataset.py | Added _resolve_target_ignore_labels method and integrated ignore values into chunk volumes and skeleton transforms |
| vesuvius/src/vesuvius/models/training/train.py | Enhanced loss initialization and metrics to accept ignore values from target configuration |
| vesuvius/src/vesuvius/models/augmentation/transforms/utils/skeleton_transform.py | Modified skeleton transform to handle ignore values during processing |
| vesuvius/pyproject.toml | Updated package dependencies including version changes and new packages |
Comments suppressed due to low confidence (1)
vesuvius/pyproject.toml:64
- The version
s3fs>=2025.9.0appears to use a future version number. As of January 2025, s3fs follows calendar versioning similar to fsspec. Version 2025.9.0 may not exist yet. Please verify this is the correct version.
"s3fs>=2025.9.0",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| MedialSurfaceTransform( | ||
| do_tube=False, | ||
| target_keys=skeleton_targets, | ||
| ignore_values=ignore_values or None, |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expression ignore_values or None is redundant. An empty dict {} is falsy, so this will return None when ignore_values is empty. Consider simplifying to just ignore_values and let the transform handle the empty dict, or use ignore_values if ignore_values else None to be more explicit about the intent.
| MedialSurfaceTransform( | ||
| do_tube=False, | ||
| target_keys=skeleton_targets, | ||
| ignore_values=ignore_values or None, |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The expression ignore_values or None is redundant. An empty dict {} is falsy, so this will return None when ignore_values is empty. Consider simplifying to just ignore_values and let the transform handle the empty dict, or use ignore_values if ignore_values else None to be more explicit about the intent.
| ignore_values=ignore_values or None, | |
| ignore_values=ignore_values if ignore_values else None, |
| else: | ||
| try: | ||
| mask = (arr == ignore_label) | ||
| except TypeError: |
Copilot
AI
Nov 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statement is unreachable.
|
@bruniss what's this? |
No description provided.