Release 2.6.1
Summary
- Add optional box-aware crop sampling for detection pipelines that must retain one selected box or every annotated box.
- Correct oriented-box geometry and replay mapping across resize, perspective, crop, and remap operations.
- Validate root inputs before sampling, including calls skipped by
p=0, and preserve the order of repeated replay visits. - Fix Macenko stain estimation to use the two largest optical-density principal components.
Breaking changes
Custom transform dispatch
BasicTransform and DualTransform now own sampled-parameter dispatch. Overrides of apply_with_params and _apply_with_params are rejected. Generate values in sample_parameters, return SampledParams, and implement target handlers such as apply or apply_to_mask. See the custom transform guidance. #622
Input validation
Invalid declared arguments and malformed root inputs now fail before sampling randomness, including calls skipped by p=0. Incorrect argument kinds raise TypeError; invalid values raise ValueError. Positional sample arguments also raise TypeError. Correct invalid configurations and inputs, and update exception handlers that relied on the previous error types. #620
Malformed replay records now raise explicit TypeError or ValueError exceptions for invalid kinds, missing fields, unknown classes, or missing named Lambda bindings. Worker RNG lookup errors now propagate instead of silently selecting another stream. #620
Direct bounding-box calls
Direct transform calls without a bbox processor now interpret boxes as normalized horizontal boxes. Pass normalized coordinates or use Compose with explicit BboxParams for other formats and oriented boxes. #621
New features
RandomResizedCrop: preserve boxes in the crop
Set bbox_preservation="one_box" to require the crop to contain one uniformly selected box across active bbox fields, or "all_boxes" to contain every box. With no boxes, ordinary sampling is used. The transform relaxes scale and aspect-ratio bounds only as needed to satisfy the box constraint; configured BboxParams filters still apply. The default None preserves existing sampling. #630
Bug fixes
- LongestMaxSize, SmallestMaxSize, LetterBox, CropAndPad, RandomSizedCrop, RandomResizedCrop, and RandomSizedBBoxSafeCrop now fit oriented boxes in output pixel coordinates after rounded or anisotropic resize and crop-resize.
- Perspective and GridElasticDeform share sampled geometry across image and annotation targets. Remap distortions fit visible polygon envelopes, and identity remaps preserve fractional oriented-box geometry.
CropAndPadretains one center pixel on an axis when the configured crop would otherwise exhaust it.- Resize-family replay maps keypoints and oriented boxes from the current input frame, using a nonempty spatial target to discover the frame shape while keeping recorded output sizes and letterbox padding authoritative.
- Repeated and reordered transform visits retain their individual parameters and execution order in replay. Skipped leaves clear prior observations.
- HEStain with
method="macenko"now uses the row-oriented eigenvectors returned bycv2.eigento fit the principal-component plane. The recovered hematoxylin and eosin vectors now match the expected stain directions. #629 · #631
Misc
- Clarifies the supported FP16 targets in public transform metadata and fixes a copied link in the determinism guide. #625 · #628
Commits
| Commit | PR | Description |
|---|---|---|
ae88348 | #620 | Enforce pipeline validation before sampling |
035b9c8 | #621 | Define and enforce the 2D geometry contract |
6dfaaa0 | #622 | Enforce deterministic pipeline and ordered replay contracts |
fbba9b7 | #623 | Require behavior-change and migration evidence for releases |
1652cfc | #628 | Fix copied determinism guide link |
f14b8b6 | #625 | Document FP16 in public transform metadata |
39c2b2b | #630 | Add optional bbox preservation to RandomResizedCrop |
6acc7d0 | #631 | Select OpenCV eigenvector rows in Macenko |
fdcaa02 | #632 | Bump version to 2.6.1 |
741115a | #632 | Run release report generator as a module |
b66851f | #632 | Merge the 2.6.1 release PR |
Full changelog: 2.6.0…2.6.1