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
MMCV
Commits
b852c1c4
Unverified
Commit
b852c1c4
authored
Nov 23, 2022
by
谢昕辰
Committed by
GitHub
Nov 23, 2022
Browse files
[Fix] Fix a not proper assertion in RandomChoiceResize (#2450)
* fix assertion * remove assert * use is_seq_of
parent
a0939977
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
mmcv/transforms/processing.py
mmcv/transforms/processing.py
+1
-2
No files found.
mmcv/transforms/processing.py
View file @
b852c1c4
...
@@ -1063,7 +1063,7 @@ class RandomChoiceResize(BaseTransform):
...
@@ -1063,7 +1063,7 @@ class RandomChoiceResize(BaseTransform):
self
.
scales
=
scales
self
.
scales
=
scales
else
:
else
:
self
.
scales
=
[
scales
]
self
.
scales
=
[
scales
]
assert
mmengine
.
is_
list
_of
(
self
.
scales
,
tuple
)
assert
mmengine
.
is_
seq
_of
(
self
.
scales
,
(
tuple
,
int
)
)
self
.
resize_cfg
=
dict
(
type
=
resize_type
,
**
resize_kwargs
)
self
.
resize_cfg
=
dict
(
type
=
resize_type
,
**
resize_kwargs
)
# create a empty Resize object
# create a empty Resize object
...
@@ -1079,7 +1079,6 @@ class RandomChoiceResize(BaseTransform):
...
@@ -1079,7 +1079,6 @@ class RandomChoiceResize(BaseTransform):
``scale_idx`` is the selected index in the given candidates.
``scale_idx`` is the selected index in the given candidates.
"""
"""
assert
mmengine
.
is_list_of
(
self
.
scales
,
tuple
)
scale_idx
=
np
.
random
.
randint
(
len
(
self
.
scales
))
scale_idx
=
np
.
random
.
randint
(
len
(
self
.
scales
))
scale
=
self
.
scales
[
scale_idx
]
scale
=
self
.
scales
[
scale_idx
]
return
scale
,
scale_idx
return
scale
,
scale_idx
...
...
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