Unverified Commit b852c1c4 authored by 谢昕辰's avatar 谢昕辰 Committed by GitHub
Browse files

[Fix] Fix a not proper assertion in RandomChoiceResize (#2450)

* fix assertion

* remove assert

* use is_seq_of
parent a0939977
......@@ -1063,7 +1063,7 @@ class RandomChoiceResize(BaseTransform):
self.scales = scales
else:
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)
# create a empty Resize object
......@@ -1079,7 +1079,6 @@ class RandomChoiceResize(BaseTransform):
``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 = self.scales[scale_idx]
return scale, scale_idx
......
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