pytorch / vision

Datasets, Transforms and Models specific to Computer Vision
https://pytorch.org/vision
BSD 3-Clause "New" or "Revised" License
16.19k stars 6.95k forks source link

CutMix/MixUp arguments #8693

Closed skrbnv closed 1 week ago

skrbnv commented 2 weeks ago

🚀 The feature

It feels like args for v2 CutMix/MixUp are over-engineered: instead of current logic with labels_getter, it would be easier to pass labels as separate argument. Then you won't need to guess where labels are and be able to safely process unlimited number of input stacks.

Motivation, pitch

Currently only one input stack could be processed via CutMix/MixUp, although args allow to pass *. Passing labels separately from inputs will allow to simplify logic and process all inputs.

Alternatives

No response

Additional context

No response

NicolasHug commented 2 weeks ago

Hi @skrbnv , can you provide an example of the UX you're thinking of?

skrbnv commented 1 week ago

Hi @skrbnv , can you provide an example of the UX you're thinking of?

Just realized that * as inputs for the forward() call and all that detection heuristics are probably for it to be compatible with existing Compose sequence. Probably RN best option to transform (not ignore) multiple inputs beyond first stack is to override _needs_transform_list().