batchgeneratorsv2
Batchgenerators but better
What it is and what it does
batchgeneratorsv2 is a rewrite of the batchgenerators framework for medical image analysis and deep learning pipelines. It provides data augmentation transforms that explicitly handle different data types—images, segmentation masks, pixel-wise regression targets, keypoints, and bounding boxes—with transforms applied at the sample level rather than batch level. The package prioritizes CPU performance and uses PyTorch implementations where possible, though it remains in early development with only a subset of the original transforms currently available.
The package is built for workflows that need reliable, type-aware augmentation for medical imaging and computer vision tasks. It depends on torch, numpy, and the original batchgenerators package, making it suitable for projects already using PyTorch. The explicit distinction between data types means you don't have to manually manage which transforms apply to which parts of your data.
Use it for:
- Augment medical imaging datasets for segmentation tasks while preserving label correspondence
- Apply sample-level transforms in medical image analysis pipelines built with nnU-Net
- Preprocess images, masks, and keypoints together with type-aware augmentation for detection workflows
- Build CPU-optimized data loading pipelines for deep learning without GPU augmentation overhead
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reimplemented data augmentation transforms for deep learning, optimized for CPU performance and designed to work with torch and numpy on individual samples rather than batches.
Yes, with conditions. Install if you need sample-level, type-aware augmentation for medical imaging or computer vision and are comfortable with an early-stage library (Planning status). The low install friction, active maintenance, and permissive Apache license make it low-risk. However, verify that the currently implemented transforms cover your use case, since the package explicitly covers only a subset of the original batchgenerators.
Install
batchgeneratorsv2 on PyPI
pip
pip install batchgeneratorsv2uv
uv add batchgeneratorsv2poetry
poetry add batchgeneratorsv2Installing batchgeneratorsv2
Before you install
Low friction install with three core dependencies (torch, numpy, batchgenerators). Active maintenance status with a release 29 days ago. Early development stage (Planning) means the API and feature set may still shift.
License in practice
Apache 2.0 permissive license allows commercial and derivative use with attribution and modification notice requirements. No restrictions on redistribution or proprietary applications.
Quickstart
pip install batchgeneratorsv2
from batchgeneratorsv2.transforms import SomeTransform
import torch
import numpy as np
# Apply transforms at sample level
transform = SomeTransform()
augmented_sample = transform(sample)
Requires Python >=3.9 and torch installed. GPU-based augmentation is not supported; CPU optimization is the design focus.
Verify before relying
- Which specific transforms are currently implemented beyond the description's mention of a 'small subset'
- Performance benchmarks comparing torch-based implementations to the original batchgenerators
- API stability guarantees given the 'work in progress' status and Planning classifier
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — torch, numpy, batchgenerators |
| Maintenance | actively maintained — 29 days since the last release |
| First released | |
| Downloads | 125,259/month — #11,828 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: batchgeneratorsv2-0.3.5-py3-none-any.whl
Keywords: deep learning, image segmentation, semantic segmentation, medical image analysis, medical image segmentation, nnU-Net, nnunet
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
batchgeneratorsbatchgenerators provides data augmentation…
permissive · top 15,000 on PyPI
torchioTorchIO reads, preprocesses, augments, and…
permissive · top 15,000 on PyPI
ttachWraps PyTorch models to apply test-time…
permissive · top 15,000 on PyPI
torch-audiomentationsProvides PyTorch-native audio data augmentation…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
imgaugAugments images and related data (heatmaps,…
permissive · top 5,000 on PyPI
TotalSegmentatorAutomated segmentation of anatomical structures…
permissive · top 15,000 on PyPI
torchxrayvisionTorchXRayVision provides pre-trained deep…
permissive · top 15,000 on PyPI
augmaxAugmax is a JAX-based image data augmentation…
permissive · top 15,000 on PyPI
monaiMONAI is a PyTorch-based framework for building…
permissive · top 15,000 on PyPI