pytorch / pytorch/vision

decode + crop util?

Open
#7,774 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

https://github.com/pytorch/vision/issues/7761 made me think that maybe we could implement a decode_and_crop util that would basically be the combination of decode() + RandomCrop, but implemented at a low-level where we would only decode the desired cropped region (I assume/hope this is possible via libjpeg and others?)

I guess it could speeds things up a bit by avoiding to decode out-of-crop regions. I was hoping that it would allow us to return a batch of images of the same size, but in practice we will want different crop sizes and ratios (unless we're OK to have it constant across a batch? IDK).

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

Review issue #7761 and the existing decode() and RandomCrop APIs first. Determine whether libjpeg or other decoders can decode only the requested crop, and clarify how variable crop sizes and aspect ratios should work across a batch. Done means a scoped feasibility and design decision for a decode_and_crop utility.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.