Repository navigation
AlbumentationsX 2.7.0
Summary
- Breaking:
bboxesandkeypointsmust be NumPy arrays of shape(N, K). Lists and tuples now raiseTypeError. #715 - New batch flips for collated PyTorch batches:
sample_flipandapply_flip_flip a random subset of samples in place, on CPU or CUDA. #704 - GlassBlur no longer raises on images too small to shuffle. #718
Breaking changes
bboxes and keypoints must be NumPy arrays
Previously, Compose accepted lists and tuples of boxes and keypoints, but returned NumPy arrays. That contradicted the documented promise that sequences come back as sequences (#714). Now bboxes and keypoints must be np.ndarray of shape (N, K), and an empty set is shape (0, K). Lists, tuples, and flat (0,) arrays raise TypeError. Label fields are unchanged.
With instance binding, each instance's bbox must be a one-dimensional array and its keypoints an (N, K) array. An instance without keypoints uses shape (0, K).
Migration: wrap annotations once, before calling the pipeline.
# Before
transform(image=image, bboxes=[[10, 20, 50, 80]], labels=["cat"])
# After
transform(image=image, bboxes=np.asarray([[10, 20, 50, 80]], dtype=np.float32), labels=["cat"])
# No annotations
bboxes = np.zeros((0, 4), dtype=np.float32)New features
albumentations.batchgains batch flips for collated PyTorch batches.sample_fliptakes one direction (horizontal or vertical) and draws a yes/no flip decision per sample as aFlipPlan.apply_flip_flips the selected images or volumes in place and reuses the same plan for masks at any resolution. CPU batches flip one sample at a time. CUDA batches use an optional Triton kernel, fall back to PyTorch, and do not synchronize with the host. API reference, #704
Bug fixes
- GlassBlur: an image with a side of at most
2 * max_deltahas no pixels to swap, but sampling computed a negative count and raised, for example on 10×3 images and in fast mode on 7×5. Such images now get only the two Gaussian blur passes. Larger images sample the same values as before. #718 - Downscale: the docstring summary named the removed
scale_minandscale_maxarguments. It now namesscale_range. #719 - ImageCompression: docstring fix. #707
Misc
- Dependency updates: runtime Python dependencies, including
pydantic2.14.4 (#708), GitHub Actions (#712), and development tools (#709, #710, #711). - Agent rules moved to
.agents. The release-notes skill now links batch helpers to the API reference instead of Explore. #707, #719 - README licensing now leads with the commercial license. #702
Commits
| commit | PR | description |
|---|---|---|
| b81c55f | #702 | docs(license): lead README licensing with the commercial license |
| 878b0d6 | #707 | docs(agents): move rules to .agents, state channel contract, fix ImageCompression docstring |
| 64dd28b | #712 | fix(deps): bump the github-actions group with 3 updates |
| 9a4259a | #708 | fix(deps): bump the python-dependencies group with 7 updates |
| 9fff204 | #709 | fix(deps-dev): bump types-pyyaml from 6.0.12.20261113 to 6.0.12.20261122 |
| c3ea441 | #711 | fix(deps-dev): bump cyclonedx-bom from 8.0.1 to 9.0.0 |
| 6b0b706 | #710 | fix(deps-dev): bump types-setuptools |
| b69ed4b | #715 | fix(core)!: require NumPy arrays for bboxes and keypoints |
| 950a56c | #704 | feat(batch): flip a random subset of images horizontally or vertically |
| 8dd20b3 | #718 | fix(blur): blur GlassBlur images too small to shuffle instead of raising |
| 81d9013 | #719 | docs: link batch helpers to API reference, fix Downscale summary |
| f01c4b7 | #720 | chore(release): prepare 2.7.0 |