Skip to content

Commit 1486c54

Browse files
prabhat00155facebook-github-bot
authored andcommitted
[fbsync] Add typing annotations to detection/image_list (#4602)
Summary: * Add typing for imagelist, move params to docstring * Add docs Reviewed By: fmassa Differential Revision: D31649963 fbshipit-source-id: c70e62901fb02942f2bc2949202ddeb43a2a7410
1 parent ecf2c4d commit 1486c54

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

mypy.ini

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ ignore_errors = True
2525

2626
ignore_errors = True
2727

28-
[mypy-torchvision.models.detection.image_list]
29-
30-
ignore_errors = True
31-
3228
[mypy-torchvision.models.detection.transform]
3329

3430
ignore_errors = True

torchvision/models/detection/image_list.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ class ImageList(object):
1010
varying sizes) as a single tensor.
1111
This works by padding the images to the same size,
1212
and storing in a field the original sizes of each image
13+
14+
Args:
15+
tensors (tensor): Tensor containing images.
16+
image_sizes (list[tuple[int, int]]): List of Tuples each containing size of images.
1317
"""
1418

15-
def __init__(self, tensors: Tensor, image_sizes: List[Tuple[int, int]]):
16-
"""
17-
Args:
18-
tensors (tensor)
19-
image_sizes (list[tuple[int, int]])
20-
"""
19+
def __init__(self, tensors: Tensor, image_sizes: List[Tuple[int, int]]) -> None:
2120
self.tensors = tensors
2221
self.image_sizes = image_sizes
2322

0 commit comments

Comments
 (0)