Skip to main content

Augmax

PyPI version Documentation Status

Augmax is an image data augmentation framework supporting efficiently-composable transformations with support for JAX function transformations. Its strengths are efficient execution of complex augmentation pipelines and batched data augmentation on the GPU/TPU via the use of jax.jit and jax.vmap.

In existing data augmentation frameworks, each transformation is executed separately, leading to many unnecessary memory reads and writes that could be avoided. In contrast, Augmax tries its best to fuse transformations together, so that these data-intensive operations are be minimized.

Getting Started

Augmax aims to implement an API similar to that of Albumentations. An augmentation pipeline is defined as a sequence of transformations, which are then randomly applied to the input images.

import jax
import augmax

transform = augmax.Chain(
  augmax.RandomCrop(256, 256),
  augmax.HorizontalFlip(),
  augmax.Rotate(),
)

image = ...

rng = jax.random.PRNGKey(27)

transformed_image = transform(rng, image)

Batch-wise Augmentation on the GPU

Leveraging the JAX infrastructure, it is possible to greatly accelerate data augmentation by using Just-in-Time compilation (jax.jit), which can execute the code on the GPU, as well as batched augmentation (jax.vmap).

Augmenting a single image on the GPU

transformed_image = jax.jit(transform)(rng, image)

Augmenting an entire batch of images on the GPU

sub_rngs = jax.random.split(rng, images.shape[0])
transformed_images = jax.jit(jax.vmap(transform))(sub_rngs, images)

Metadata

Release files for augmax 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for augmax 0.4.1
File Size Uploaded
augmax-0.4.1.tar.gz 11.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for augmax 0.4.1
File Interpreter ABI Platform
augmax-0.4.1-py3-none-any.whl Python 3 none any Details

Total release size: 28.8 kB

Release files / augmax-0.4.1.tar.gz

Download URL augmax-0.4.1.tar.gz
Size 11.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d8e645203f535e243a3b16fb3634b10d4f168d1b9cfde4cda3892ab22bf31e8d
BLAKE2b-256 checksum
How to use checksums
45f00ab2080eb132cf9bb70ee96e80ff57be323b09aed563825058760404e383
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release files / augmax-0.4.1-py3-none-any.whl

Download URL augmax-0.4.1-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
60f9711a4ffc08f27d1ff0783f7c51c01e6f78e20d4581d075ebf2d904ab2d14
BLAKE2b-256 checksum
How to use checksums
f33e1cc3a97f3adbca740310de33ff41fd141f7cd9b2b5baafdfbc3dd6526255
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.3

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files

0.4.0

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page