未验证 提交 77a880c0 编写于 作者: I IMMORTAL 提交者: GitHub

fix random probability (#33751)

* fix random probability

* fix random probability
上级 f99e77c1
...@@ -555,6 +555,7 @@ class RandomHorizontalFlip(BaseTransform): ...@@ -555,6 +555,7 @@ class RandomHorizontalFlip(BaseTransform):
def __init__(self, prob=0.5, keys=None): def __init__(self, prob=0.5, keys=None):
super(RandomHorizontalFlip, self).__init__(keys) super(RandomHorizontalFlip, self).__init__(keys)
assert 0 <= prob <= 1, "probability must be between 0 and 1"
self.prob = prob self.prob = prob
def _apply_image(self, img): def _apply_image(self, img):
...@@ -589,6 +590,7 @@ class RandomVerticalFlip(BaseTransform): ...@@ -589,6 +590,7 @@ class RandomVerticalFlip(BaseTransform):
def __init__(self, prob=0.5, keys=None): def __init__(self, prob=0.5, keys=None):
super(RandomVerticalFlip, self).__init__(keys) super(RandomVerticalFlip, self).__init__(keys)
assert 0 <= prob <= 1, "probability must be between 0 and 1"
self.prob = prob self.prob = prob
def _apply_image(self, img): def _apply_image(self, img):
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册