pytorch / vision

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

Align query_chw and get_dimensions #7809

Open pmeier opened 1 year ago

pmeier commented 1 year ago

We have to proper combination

https://github.com/pytorch/vision/blob/9b82df43341a6891f652be1803abd1d1d05bfbb2/torchvision/transforms/v2/functional/_meta.py#L84

https://github.com/pytorch/vision/blob/9b82df43341a6891f652be1803abd1d1d05bfbb2/torchvision/transforms/v2/utils.py#L35

However, we have the combination below that diverges on the name

https://github.com/pytorch/vision/blob/9b82df43341a6891f652be1803abd1d1d05bfbb2/torchvision/transforms/v2/functional/_meta.py#L15

https://github.com/pytorch/vision/blob/9b82df43341a6891f652be1803abd1d1d05bfbb2/torchvision/transforms/v2/utils.py#L21

I don't recall anymore how we ended up with this, but we should correct it.

My vote is out for also calling it query_dimensions since we already have

https://github.com/pytorch/vision/blob/9b82df43341a6891f652be1803abd1d1d05bfbb2/torchvision/transforms/functional.py#L64

in v1.

cc @vfdev-5

Brooklynn29 commented 1 year ago

Hello !, I'm looking forward to contribute, how can I do that ?

NicolasHug commented 1 year ago

Can we get rid of the query* stuff and just let get* accept both single datapoints/tensors and flat inputs?

And BTW, since we're not providing public APIs to flatten / unflatten inputs nor to handle arbitrary structures in custom transforms, I don't think we need to make query* public (should we keep it).