pytorch / pytorch/vision

Batched (random) augmentations

Open
#8,484 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
17.9k
Forks
7.3k
Avg merge
1d 15h
Merged PRs (30d)
13

Description

🚀 The feature

Randomly sample augmentation parameters for each image in the batch

Motivation, pitch

Torch augmentations have two big advantages over alternatives like Albumentations: ability to apply them to a batch of images and ability to run them on GPU. This can make a big difference when batch size is very large (e.g., 1000). However, right now augmentation pipeline would apply exactly the same transformation to every image in the batch, which makes augmentations less valuable and can destabilize the training because of significantly chaged batch statistics.

Alternatives

Any recommendations to existing libraries that allow batched + GPU augmentations?

Additional context

In some of my training pipelines I observed that Albumentations are not fast enough and that we can benefit from going back to torchvision, but then I noticed that all images are augmented in the same way.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or an implementation entry point. Start by locating torchvision's batched augmentation pipeline and existing parameter-sampling behavior; done would mean defining and validating per-image random parameters while preserving batched and GPU execution.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.