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
0367c219
Unverified
Commit
0367c219
authored
Apr 19, 2024
by
Nicolas Hug
Committed by
GitHub
Apr 19, 2024
Browse files
Typo: bouding -> bounding (#8386)
parent
ba94133f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
gallery/transforms/plot_transforms_e2e.py
gallery/transforms/plot_transforms_e2e.py
+1
-1
test/test_transforms_v2.py
test/test_transforms_v2.py
+1
-1
torchvision/transforms/v2/functional/_misc.py
torchvision/transforms/v2/functional/_misc.py
+2
-2
No files found.
gallery/transforms/plot_transforms_e2e.py
View file @
0367c219
...
@@ -93,7 +93,7 @@ plot([dataset[0], dataset[1]])
...
@@ -93,7 +93,7 @@ plot([dataset[0], dataset[1]])
# ----------
# ----------
#
#
# Let's now define our pre-processing transforms. All the transforms know how
# Let's now define our pre-processing transforms. All the transforms know how
# to handle images, bouding boxes and masks when relevant.
# to handle images, bou
n
ding boxes and masks when relevant.
#
#
# Transforms are typically passed as the ``transforms`` parameter of the
# Transforms are typically passed as the ``transforms`` parameter of the
# dataset so that they can leverage multi-processing from the
# dataset so that they can leverage multi-processing from the
...
...
test/test_transforms_v2.py
View file @
0367c219
...
@@ -5930,7 +5930,7 @@ class TestSanitizeBoundingBoxes:
...
@@ -5930,7 +5930,7 @@ class TestSanitizeBoundingBoxes:
with
pytest
.
raises
(
ValueError
,
match
=
"canvas_size must be None when bounding_boxes is a tv_tensors"
):
with
pytest
.
raises
(
ValueError
,
match
=
"canvas_size must be None when bounding_boxes is a tv_tensors"
):
F
.
sanitize_bounding_boxes
(
good_bbox
,
format
=
"XYXY"
,
canvas_size
=
None
)
F
.
sanitize_bounding_boxes
(
good_bbox
,
format
=
"XYXY"
,
canvas_size
=
None
)
with
pytest
.
raises
(
ValueError
,
match
=
"bouding_boxes must be a tv_tensors.BoundingBoxes instance or a"
):
with
pytest
.
raises
(
ValueError
,
match
=
"bou
n
ding_boxes must be a tv_tensors.BoundingBoxes instance or a"
):
F
.
sanitize_bounding_boxes
(
good_bbox
.
tolist
())
F
.
sanitize_bounding_boxes
(
good_bbox
.
tolist
())
...
...
torchvision/transforms/v2/functional/_misc.py
View file @
0367c219
...
@@ -328,12 +328,12 @@ def sanitize_bounding_boxes(
...
@@ -328,12 +328,12 @@ def sanitize_bounding_boxes(
bounding_boxes
=
bounding_boxes
[
valid
]
bounding_boxes
=
bounding_boxes
[
valid
]
else
:
else
:
if
not
isinstance
(
bounding_boxes
,
tv_tensors
.
BoundingBoxes
):
if
not
isinstance
(
bounding_boxes
,
tv_tensors
.
BoundingBoxes
):
raise
ValueError
(
"bouding_boxes must be a tv_tensors.BoundingBoxes instance or a pure tensor."
)
raise
ValueError
(
"bou
n
ding_boxes must be a tv_tensors.BoundingBoxes instance or a pure tensor."
)
if
format
is
not
None
or
canvas_size
is
not
None
:
if
format
is
not
None
or
canvas_size
is
not
None
:
raise
ValueError
(
raise
ValueError
(
"format and canvas_size must be None when bounding_boxes is a tv_tensors.BoundingBoxes instance. "
"format and canvas_size must be None when bounding_boxes is a tv_tensors.BoundingBoxes instance. "
f
"Got format=
{
format
}
and canvas_size=
{
canvas_size
}
. "
f
"Got format=
{
format
}
and canvas_size=
{
canvas_size
}
. "
"Leave those to None or pass bouding_boxes as a pure tensor."
"Leave those to None or pass bou
n
ding_boxes as a pure tensor."
)
)
valid
=
_get_sanitize_bounding_boxes_mask
(
valid
=
_get_sanitize_bounding_boxes_mask
(
bounding_boxes
,
format
=
bounding_boxes
.
format
,
canvas_size
=
bounding_boxes
.
canvas_size
,
min_size
=
min_size
bounding_boxes
,
format
=
bounding_boxes
.
format
,
canvas_size
=
bounding_boxes
.
canvas_size
,
min_size
=
min_size
...
...
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