当前位置: 首页>>代码示例>>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;未经允许,请勿转载。