當前位置: 首頁>>代碼示例>>Python>>正文


Python imgaug.new_random_state方法代碼示例

本文整理匯總了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 
開發者ID:minerva-ml,項目名稱:steppy-toolkit,代碼行數:11,代碼來源:utils.py

示例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) 
開發者ID:aleju,項目名稱:imgaug,代碼行數:11,代碼來源:test_imgaug.py

示例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) 
開發者ID:aleju,項目名稱:imgaug,代碼行數:11,代碼來源:test_imgaug.py

示例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) 
開發者ID:aleju,項目名稱:imgaug,代碼行數:11,代碼來源:test_imgaug.py

示例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 
開發者ID:neptune-ai,項目名稱:open-solution-mapping-challenge,代碼行數:8,代碼來源:utils.py


注:本文中的imgaug.new_random_state方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。