Skip to content

Add typing annotations to detection/image_list #4602

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

Merged
merged 2 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ ignore_errors = True

ignore_errors = True

[mypy-torchvision.models.detection.image_list]

ignore_errors = True

[mypy-torchvision.models.detection.transform]

ignore_errors = True
Expand Down
11 changes: 5 additions & 6 deletions torchvision/models/detection/image_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ class ImageList(object):
varying sizes) as a single tensor.
This works by padding the images to the same size,
and storing in a field the original sizes of each image

Args:
tensors (tensor): Tensor containing images.
image_sizes (list[tuple[int, int]]): List of Tuples each containing size of images.
"""

def __init__(self, tensors: Tensor, image_sizes: List[Tuple[int, int]]):
"""
Args:
tensors (tensor)
image_sizes (list[tuple[int, int]])
"""
def __init__(self, tensors: Tensor, image_sizes: List[Tuple[int, int]]) -> None:
self.tensors = tensors
self.image_sizes = image_sizes

Expand Down