skillfed

batchgeneratorsv2

Batchgenerators but better

batchgeneratorsv2 v0.3.5 125.3K downloads/30d#11,828 on PyPI
Permissive 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) Active released

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 batchgeneratorsv2

uv

uv add batchgeneratorsv2

poetry

poetry add batchgeneratorsv2

Installing 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

Development Status :: 1 - PlanningIntended Audience :: DevelopersIntended Audience :: Healthcare IndustryIntended Audience :: Science/ResearchLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Topic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Scientific/Engineering :: Image RecognitionTopic :: Scientific/Engineering :: Medical Science Apps.

Tags

data augmentation transformsmedical image augmentationbatch data generationsample-level transformsdeep learning preprocessingimage segmentation augmentationtorch-based augmentation
medical-imagingdata-augmentationpytorch

More Artificial Intelligence packages