Skip to content
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

Ignore mypy for prototype.transforms.* #8403

Merged
merged 2 commits into from
May 3, 2024

Conversation

NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented May 3, 2024

Towards #8377

This removes the following mypy errors:

  torchvision/prototype/transforms/_presets.py:47: error: Incompatible types in
  assignment (expression has type "Tensor", variable has type "Image") 
  [assignment]
                      img = F.pil_to_tensor(img)
                            ^~~~~~~~~~~~~~~~~~~~
  torchvision/prototype/transforms/_presets.py:53: error: Incompatible types in
  assignment (expression has type "Tensor", variable has type "Image") 
  [assignment]
                      img = F.resize(img, self.resize_size, interpolation=se...
                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
  torchvision/prototype/transforms/_presets.py:53: error: Argument 1 to "resize"
  has incompatible type "Image"; expected "Tensor"  [arg-type]
                      img = F.resize(img, self.resize_size, interpolation=se...
                                     ^~~
  torchvision/prototype/transforms/_presets.py:55: error: Incompatible types in
  assignment (expression has type "Tensor", variable has type "Image") 
  [assignment]
                      img = F.rgb_to_grayscale(img)
                            ^~~~~~~~~~~~~~~~~~~~~~~
  torchvision/prototype/transforms/_presets.py:55: error: Argument 1 to
  "rgb_to_grayscale" has incompatible type "Image"; expected "Tensor"  [arg-type]
                      img = F.rgb_to_grayscale(img)
                                               ^~~
  torchvision/prototype/transforms/_presets.py:56: error: Argument 1 to
  "convert_image_dtype" has incompatible type "Image"; expected "Tensor" 
  [arg-type]
                  img = F.convert_image_dtype(img, torch.float)
                                              ^~~
  torchvision/prototype/transforms/_presets.py:61: error: Argument 1 to
  "_process_image" has incompatible type "Tensor"; expected "Image"  [arg-type]
              left_image = _process_image(left_image)
                                          ^~~~~~~~~~
  torchvision/prototype/transforms/_presets.py:62: error: Argument 1 to
  "_process_image" has incompatible type "Tensor"; expected "Image"  [arg-type]
              right_image = _process_image(right_image)

Those are (I assume) partly due to incorrect annotation, partly due to incompatibilities between torchscript and mypy. In any case, this is the prototype module and that file only contains the stereo presets which is an area that hasn't been developed/maintained in a while.

cc @bjuncek

Copy link

pytorch-bot bot commented May 3, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8403

Note: Links to docs will display an error until the docs builds have been completed.

❌ 16 New Failures, 20 Unrelated Failures

As of commit 8ac6db3 with merge base 11db385 (image):

NEW FAILURES - The following jobs have failed:

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@NicolasHug NicolasHug merged commit 8134306 into pytorch:main May 3, 2024
9 of 22 checks passed
@NicolasHug NicolasHug deleted the aefjbalfjenaef branch May 3, 2024 10:24
Copy link

github-actions bot commented May 3, 2024

Hey @NicolasHug!

You merged this PR, but no labels were added.
The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

facebook-github-bot pushed a commit that referenced this pull request May 8, 2024
Reviewed By: vmoens

Differential Revision: D57099454

fbshipit-source-id: 56a8923b6a56a1bb2794f29be847d44259eec97a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants