本文整理匯總了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