当前位置: 首页>>代码示例>>Python>>正文


Python io.import_builtin_asset函数代码示例

本文整理汇总了Python中menpo.io.import_builtin_asset函数的典型用法代码示例。如果您正苦于以下问题:Python import_builtin_asset函数的具体用法?Python import_builtin_asset怎么用?Python import_builtin_asset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了import_builtin_asset函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_uint8_type_single_array

def test_uint8_type_single_array():
    image = mio.import_builtin_asset('breakingbad.jpg', normalise=False)
    patch_shape = (16, 16)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    patch_shape=patch_shape,
                                    as_single_array=True)
    assert(patches.dtype == np.uint8)
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例2: test_nonsquared_odd_patches

def test_nonsquared_odd_patches():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (15, 17)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    patch_shape=patch_shape,
                                    as_single_array=False)
    assert_equals(len(patches), 68)
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例3: test_squared_even_patches_sample_offsets

def test_squared_even_patches_sample_offsets():
    image = mio.import_builtin_asset('breakingbad.jpg')
    sample_offsets = np.array([[0, 0], [1, 0]])
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    sample_offsets=sample_offsets,
                                    as_single_array=False)
    assert_equals(len(patches), 136)
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例4: test_warp_multi

def test_warp_multi():
    rgb_image = mio.import_builtin_asset('takeo.ppm')
    target_transform = Affine.init_identity(2).from_vector(initial_params)
    warped_im = rgb_image.warp_to_mask(template_mask, target_transform)

    assert(warped_im.shape == rgb_template.shape)
    assert_allclose(warped_im.pixels, rgb_template.pixels)
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:7,代码来源:image_warp_test.py

示例5: test_squared_even_patches_single_array

def test_squared_even_patches_single_array():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (16, 16)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    as_single_array=True,
                                    patch_shape=patch_shape)
    assert_equals(patches.shape, ((68, 1, 3) + patch_shape))
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例6: test_double_type

def test_double_type():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (16, 16)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    patch_shape=patch_shape,
                                    as_single_array=False)
    assert(patches[0].pixels.dtype == np.float64)
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例7: test_import_asset_bunny

def test_import_asset_bunny():
    mesh = mio.import_builtin_asset('bunny.obj')
    assert(isinstance(mesh, TriMesh))
    assert(isinstance(mesh.points, np.ndarray))
    assert(mesh.points.shape[1] == 3)
    assert(isinstance(mesh.trilist, np.ndarray))
    assert(mesh.trilist.shape[1] == 3)
开发者ID:dubzzz,项目名称:menpo,代码行数:7,代码来源:io_test.py

示例8: test_squared_even_patches_landmarks

def test_squared_even_patches_landmarks():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (16, 16)
    patches = image.extract_patches_around_landmarks('PTS',
                                                     patch_shape=patch_shape,
                                                     as_single_array=False)
    assert_equals(len(patches), 68)
开发者ID:HaoyangWang,项目名称:menpo,代码行数:7,代码来源:image_patches_test.py

示例9: test_squared_even_patches_sample_offsets

def test_squared_even_patches_sample_offsets():
    image = mio.import_builtin_asset('breakingbad.jpg')
    image = labeller(image, 'PTS', ibug_face_68)
    sample_offsets = PointCloud([[0, 0], [1, 0]])
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    sample_offsets=sample_offsets)
    assert_equals(len(patches), 136)
开发者ID:OlivierML,项目名称:menpo,代码行数:7,代码来源:image_extract_patches_test.py

示例10: test_nonsquared_even_patches

def test_nonsquared_even_patches():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (16, 18)
    patches = image.extract_patches(image.landmarks['PTS'],
                                    patch_shape=patch_shape,
                                    as_single_array=False)
    assert len(patches) == 68
开发者ID:AshwinRajendraprasad,项目名称:menpo,代码行数:7,代码来源:test_image_patches.py

示例11: test_float_type

def test_float_type():
    image = mio.import_builtin_asset('breakingbad.jpg')
    image.pixels = image.pixels.astype(np.float32)
    patch_shape = (16, 16)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    patch_size=patch_shape)
    assert(patches[0].pixels.dtype == np.float32)
开发者ID:luukhoavn,项目名称:menpo,代码行数:7,代码来源:image_extract_patches_test.py

示例12: test_squared_even_patches

def test_squared_even_patches():
    image = mio.import_builtin_asset('breakingbad.jpg')
    patch_shape = (16, 16)
    patches = extract_local_patches_fast(
        image, image.landmarks['PTS'].lms, patch_shape)
    print patches.shape
    assert(patches.shape == (68,) + patch_shape + (3,))
开发者ID:kod3r,项目名称:menpo,代码行数:7,代码来源:functions_test.py

示例13: test_ioinfo

def test_ioinfo():
    # choose a random asset (all should have it!)
    img = pio.import_builtin_asset('einstein.jpg')
    path = pio.data_path_to('einstein.jpg')
    assert(img.ioinfo.filepath == path)
    assert(img.ioinfo.filename == 'einstein')
    assert(img.ioinfo.extension == '.jpg')
    assert(img.ioinfo.dir == pio.data_dir_path())
开发者ID:ikassi,项目名称:menpo,代码行数:8,代码来源:io_test.py

示例14: test_squared_even_patches_single_array

def test_squared_even_patches_single_array():
    image = mio.import_builtin_asset('breakingbad.jpg')
    image = labeller(image, 'PTS', ibug_face_68)
    patch_shape = (16, 16)
    patches = image.extract_patches(image.landmarks['PTS'].lms,
                                    as_single_array=True,
                                    patch_size=patch_shape)
    assert_equals(patches.shape, ((68,) + patch_shape + (3,)))
开发者ID:Amos-zq,项目名称:menpo,代码行数:8,代码来源:image_extract_patches_test.py

示例15: test_squared_even_patches_landmarks_label

def test_squared_even_patches_landmarks_label():
    image = mio.import_builtin_asset('breakingbad.jpg')
    image = labeller(image, 'PTS', ibug_face_68)
    patch_shape = (16, 16)
    patches = image.extract_patches_around_landmarks('ibug_face_68',
                                                     label='nose',
                                                     patch_size=patch_shape)
    assert_equals(len(patches), 9)
开发者ID:OlivierML,项目名称:menpo,代码行数:8,代码来源:image_extract_patches_test.py


注:本文中的menpo.io.import_builtin_asset函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。