Repository navigation
Keep resized results for list and tuple inputs - #146
Merged
FabianIsensee merged 1 commit intoOct 29, 2026
Merged
Conversation
Return the computed data and segmentation when ResizeTransform and ZoomTransform do not concatenate their results. Preserve list and tuple containers and leave the existing ndarray path unchanged. Cover 2D and 3D batches, mixed containers, optional segmentation, concatenation, and samples with different sizes. Signed-off-by: Don Yin <[email protected]>
Member
|
thanks! |
FabianIsensee
added a commit
that referenced
this pull request
Oct 29, 2026
Augmenters (MultiThreadedAugmenter, NonDetMultiThreadedAugmenter): - With seeds=None, all forked workers drew the same torch random numbers, so transforms that draw from torch (all of batchgeneratorsv2, hence nnU-Net's training augmentation) repeated the same augmentation sequence in every worker. Workers now reseed torch from the OS. - With seeds given, workers also seed torch (from a seed derived from the given one) and random (PR #139). numpy integer seeds work. - Workers restore the default SIGTERM handler (PR #127) and stop when their parent is killed, also under fork when the parent forked other processes after them. - next() raises instead of waiting forever when the results thread fails; shutting down with torch tensor batches no longer prints tracebacks from the results thread. - Logging goes through named module loggers instead of the root logger (PR #140). Augmentations: - Scale, contrast and gamma ranges that end at or below one are sampled from the range (PR #144, issue #137). - Random crops can draw the last valid origin (PR #143, issue #142, and the random_crop_* helpers in utils.py). - ChannelTranslation keeps the batch dimension (PR #145) and the channel order, can shift by +max_shift and accepts max_shift 0. - ResizeTransform and ZoomTransform return their results for list and tuple inputs (PR #146). Packaging: unittest2 and future are no longer required, numpy>=1.17; requirements.txt and the Makefile are gone. The CIFAR-10 example runs again. Seeded runs draw differently for random crops, channel translation, torch-based transforms under the augmenters and ranges ending at one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
ResizeTransformandZoomTransformcompute resized samples but return the original data when list or tuple inputs use the defaultconcatenate_list=False. For example, resizing a 4×4 sample to 2×2, or zooming it by 0.5, returns 4×4 image and segmentation arrays.This returns the computed sequences while preserving list/tuple types and the existing ndarray and concatenation paths. The regressions cover 2D/3D batches, mixed image/segmentation containers, optional segmentation, and samples with different sizes.
Measured output sizes for synthetic 4×4 inputs, with both interpolation orders set to zero:
Validation
Python 3.12.0, NumPy 2.4.2, SciPy 1.17.1, scikit-image 0.25.2:
The spatial and broader suites report the same existing scikit-image warning for the empty-input segmentation test as the baseline.