Unverified Commit 203671ab authored by Aditya Oke's avatar Aditya Oke Committed by GitHub
Browse files

Add typing annotations to detection/image_list (#4602)

* Add typing for imagelist, move params to docstring

* Add docs
parent c790216a
...@@ -25,10 +25,6 @@ ignore_errors = True ...@@ -25,10 +25,6 @@ ignore_errors = True
ignore_errors = True ignore_errors = True
[mypy-torchvision.models.detection.image_list]
ignore_errors = True
[mypy-torchvision.models.detection.transform] [mypy-torchvision.models.detection.transform]
ignore_errors = True ignore_errors = True
......
...@@ -10,14 +10,13 @@ class ImageList(object): ...@@ -10,14 +10,13 @@ class ImageList(object):
varying sizes) as a single tensor. varying sizes) as a single tensor.
This works by padding the images to the same size, This works by padding the images to the same size,
and storing in a field the original sizes of each image and storing in a field the original sizes of each image
"""
def __init__(self, tensors: Tensor, image_sizes: List[Tuple[int, int]]):
"""
Args: Args:
tensors (tensor) tensors (tensor): Tensor containing images.
image_sizes (list[tuple[int, int]]) 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]]) -> None:
self.tensors = tensors self.tensors = tensors
self.image_sizes = image_sizes self.image_sizes = image_sizes
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment