pytorch / pytorch/vision

[Feature Request] Support same_on_batch option for transforms

Open
#2,929 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

🚀 Feature

In the latest torchvison, transforms support tensor input (very nice feature, cheers!).

Motivation

As titled, same_on_batch option is not available for torchvision transforms. For example, RandomResizedCrop will crop at the same location for all images in the batch (which is ideal for video, but not for batched images).

Pitch

Kornia has this feature off the shelf. Maybe torchvision could follow the same API.

cc @vfdev-5

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

Start by reading the torchvision transforms implementation, especially RandomResizedCrop, and inspect how tensor batches are currently handled. Compare the requested behavior with Kornia's same_on_batch API; done means the option is consistently supported by the relevant transforms with batch semantics documented and tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
computer-vision
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.