pytorch / pytorch/vision

Transforms with nested tensor

Open
#7,761 3 comments 0 reactions 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

For batched inference on images of different sizes, we need to do the following

  • Resize each image to the same size and convert to a tensor
  • Stack the batch of tensors
  • Do further image transformations on the batched tensors
  • Run inference

It would be nice to do the following instead

  • create a nested tensor of images of different sizes
  • Run transformation including resizing on the nested tensor
  • Run inference
Motivation, pitch

This would result in improved performance for image pre-processing

Alternatives
  • Resize each image to the same size and convert to a tensor
  • Stack the batch of tensors
Additional context

No response

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 reviewing the repository's image transformation entry points and any existing nested-tensor support. Determine how resizing and subsequent batched transformations are currently handled, then verify that images with different sizes can remain nested through preprocessing and inference without the existing resize-and-stack alternative.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.