Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
203671ab
Unverified
Commit
203671ab
authored
Oct 13, 2021
by
Aditya Oke
Committed by
GitHub
Oct 12, 2021
Browse files
Add typing annotations to detection/image_list (#4602)
* Add typing for imagelist, move params to docstring * Add docs
parent
c790216a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
10 deletions
+5
-10
mypy.ini
mypy.ini
+0
-4
torchvision/models/detection/image_list.py
torchvision/models/detection/image_list.py
+5
-6
No files found.
mypy.ini
View file @
203671ab
...
...
@@ -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
...
...
torchvision/models/detection/image_list.py
View file @
203671ab
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment