本文整理汇总了Python中imgaug.new_random_state方法的典型用法代码示例。如果您正苦于以下问题:Python imgaug.new_random_state方法的具体用法?Python imgaug.new_random_state怎么用?Python imgaug.new_random_state使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类imgaug
的用法示例。
在下文中一共展示了imgaug.new_random_state方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: reseed
# 需要导入模块: import imgaug [as 别名]
# 或者: from imgaug import new_random_state [as 别名]
def reseed(augmenter, deterministic=True):
augmenter.random_state = ia.new_random_state(get_seed())
if deterministic:
augmenter.deterministic = True
for lists in augmenter.get_children_lists():
for aug in lists:
aug = reseed(aug, deterministic=True)
return augmenter
示例2: test_new_random_state__induce_pseudo_random
# 需要导入模块: import imgaug [as 别名]
# 或者: from imgaug import new_random_state [as 别名]
def test_new_random_state__induce_pseudo_random(mock_rng):
with warnings.catch_warnings(record=True) as caught_warnings:
warnings.simplefilter("always")
_ = ia.new_random_state(seed=None, fully_random=False)
assert mock_rng.create_pseudo_random_.call_count == 1
assert len(caught_warnings) == 1
assert "is deprecated" in str(caught_warnings[-1].message)
示例3: test_new_random_state__induce_fully_random
# 需要导入模块: import imgaug [as 别名]
# 或者: from imgaug import new_random_state [as 别名]
def test_new_random_state__induce_fully_random(mock_rng):
with warnings.catch_warnings(record=True) as caught_warnings:
warnings.simplefilter("always")
_ = ia.new_random_state(seed=None, fully_random=True)
assert mock_rng.create_fully_random.call_count == 1
assert len(caught_warnings) == 1
assert "is deprecated" in str(caught_warnings[-1].message)
示例4: test_new_random_state__use_seed
# 需要导入模块: import imgaug [as 别名]
# 或者: from imgaug import new_random_state [as 别名]
def test_new_random_state__use_seed(mock_rng):
with warnings.catch_warnings(record=True) as caught_warnings:
warnings.simplefilter("always")
_ = ia.new_random_state(seed=1)
mock_rng.assert_called_once_with(1)
assert len(caught_warnings) == 1
assert "is deprecated" in str(caught_warnings[-1].message)
示例5: reseed
# 需要导入模块: import imgaug [as 别名]
# 或者: from imgaug import new_random_state [as 别名]
def reseed(augmenter_sequence, deterministic=True):
for aug in augmenter_sequence:
aug.random_state = ia.new_random_state(get_seed())
if deterministic:
aug.deterministic = True
return augmenter_sequence