-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NOMRG] TransformsV2 TODOs #7082
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -58,6 +58,8 @@ def _from_tensor_shape(shape: List[int]) -> ColorSpace: | |||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
class Image(Datapoint): | ||||||||||||||||||||||||||||
# For now, this is somewhat redundant with number of channels. | ||||||||||||||||||||||||||||
# TODO: decide whether we want to keep it? | ||||||||||||||||||||||||||||
Comment on lines
+61
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For context, this was designed with the use case of other color spaces with the same number of channels. For example, #4029. Since we can always add this later on, I see no harm of removing it now. That being said, I would keep the
which is a generalized replacement for
and
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While going through our source again, I noticed this: vision/torchvision/prototype/transforms/functional/_meta.py Lines 339 to 347 in 035d99f
As long as we can accurately identify the color space from the number of channels, we should either remove the
|
||||||||||||||||||||||||||||
color_space: ColorSpace | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
@classmethod | ||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,6 +244,8 @@ def resize( | |
if isinstance(inpt, torch.Tensor) and ( | ||
torch.jit.is_scripting() or not isinstance(inpt, datapoints._datapoint.Datapoint) | ||
): | ||
# TODO: Figure out whether this cond could just be: | ||
# if torch.jit.is_scripting() or is_simple_tensor(inpt): | ||
Comment on lines
+247
to
+248
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This works out 🚀 Gonna send a PR soon. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See #7084 |
||
return resize_image_tensor(inpt, size, interpolation=interpolation, max_size=max_size, antialias=antialias) | ||
elif isinstance(inpt, datapoints._datapoint.Datapoint): | ||
return inpt.resize(size, interpolation=interpolation, max_size=max_size, antialias=antialias) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most likely not. We only introduced them for internal convenience. Whenever you see something annotates with
*JIT
, you can basically look up the eager counterpart to see what is actually supported.