本文整理汇总了Python中menpo.testing.is_same_array函数的典型用法代码示例。如果您正苦于以下问题:Python is_same_array函数的具体用法?Python is_same_array怎么用?Python is_same_array使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_same_array函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_create_MaskedImage_copy_true_mask_BooleanImage
def test_create_MaskedImage_copy_true_mask_BooleanImage():
pixels = np.ones((100, 100, 1))
mask = np.ones((100, 100), dtype=np.bool)
mask_image = BooleanImage(mask, copy=False)
image = MaskedImage(pixels, mask=mask_image, copy=True)
assert (not is_same_array(image.pixels, pixels))
assert (not is_same_array(image.mask.pixels, mask))
开发者ID:Amos-zq,项目名称:menpo,代码行数:7,代码来源:image_test.py
示例2: test_pointcloud_copy_method
def test_pointcloud_copy_method():
points = np.array([[1, 2, 3], [1, 1, 1]])
landmarks = PointCloud(np.ones([3, 3]), copy=False)
p = PointCloud(points, copy=False)
p.landmarks["test"] = landmarks
p_copy = p.copy()
assert not is_same_array(p_copy.points, p.points)
assert not is_same_array(p_copy.landmarks["test"].lms.points, p.landmarks["test"].lms.points)
开发者ID:nontas,项目名称:menpo,代码行数:10,代码来源:pointcloud_test.py
示例3: test_image_copy
def test_image_copy():
pixels = np.ones([1, 10, 10])
landmarks = PointCloud(np.ones([3, 2]), copy=False)
im = Image(pixels, copy=False)
im.landmarks['test'] = landmarks
im_copy = im.copy()
assert (not is_same_array(im.pixels, im_copy.pixels))
assert (not is_same_array(im_copy.landmarks['test'].points,
im.landmarks['test'].points))
开发者ID:AshwinRajendraprasad,项目名称:menpo,代码行数:10,代码来源:test_image_copy.py
示例4: test_trimesh_creation_copy_false
def test_trimesh_creation_copy_false():
points = np.array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0]])
trilist = np.array([[0, 1, 3],
[1, 2, 3]])
tm = TriMesh(points, trilist, copy=False)
assert (is_same_array(tm.points, points))
assert (is_same_array(tm.trilist, trilist))
开发者ID:yymath,项目名称:menpo,代码行数:10,代码来源:trimish_test.py
示例5: test_booleanimage_copy
def test_booleanimage_copy():
pixels = np.ones([10, 10], dtype=np.bool)
landmarks = PointCloud(np.ones([3, 2]), copy=False)
im = BooleanImage(pixels, copy=False)
im.landmarks['test'] = landmarks
im_copy = im.copy()
assert (not is_same_array(im.pixels, im_copy.pixels))
assert (not is_same_array(im_copy.landmarks['test'].lms.points,
im.landmarks['test'].lms.points))
开发者ID:HaoyangWang,项目名称:menpo,代码行数:10,代码来源:image_copy_test.py
示例6: test_maskedimage_copy
def test_maskedimage_copy():
pixels = np.ones([10, 10, 1])
landmarks = PointCloud(np.ones([3, 2]), copy=False)
im = MaskedImage(pixels, copy=False)
im.landmarks['test'] = landmarks
im_copy = im.copy()
assert (not is_same_array(im.pixels, im_copy.pixels))
assert (im_copy.landmarks['test']._target is im_copy)
assert (not is_same_array(im_copy.landmarks['test'].lms.points,
im.landmarks['test'].lms.points))
开发者ID:dubzzz,项目名称:menpo,代码行数:11,代码来源:image_copy_test.py
示例7: test_colouredtrimesh_creation_copy_true
def test_colouredtrimesh_creation_copy_true():
points = np.array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0]])
trilist = np.array([[0, 1, 3],
[1, 2, 3]])
colours = np.ones([4, 13])
ttm = ColouredTriMesh(points, trilist, colours=colours, copy=True)
assert (not is_same_array(ttm.points, points))
assert (not is_same_array(ttm.trilist, trilist))
assert (not is_same_array(ttm.colours, colours))
开发者ID:yymath,项目名称:menpo,代码行数:12,代码来源:trimish_test.py
示例8: test_trimesh_copy
def test_trimesh_copy():
points = np.ones([10, 3])
trilist = np.ones([10, 3])
landmarks = PointCloud(np.ones([3, 3]), copy=False)
tmesh = TriMesh(points, trilist=trilist, copy=False)
tmesh.landmarks['test'] = landmarks
tmesh_copy = tmesh.copy()
assert (not is_same_array(tmesh_copy.points, tmesh.points))
assert (not is_same_array(tmesh_copy.trilist, tmesh.trilist))
assert (not is_same_array(tmesh_copy.landmarks['test'].lms.points,
tmesh.landmarks['test'].lms.points))
开发者ID:Amos-zq,项目名称:menpo,代码行数:13,代码来源:trimesh_copy_test.py
示例9: test_colouredtrimesh_copy
def test_colouredtrimesh_copy():
points = np.ones([10, 3])
colours = np.ones([10, 3])
trilist = np.ones([10, 3])
landmarks = PointCloud(np.ones([3, 3]), copy=False)
ctmesh = ColouredTriMesh(points, trilist=trilist, colours=colours,
copy=False)
ctmesh.landmarks['test'] = landmarks
ctmesh_copy = ctmesh.copy()
assert (not is_same_array(ctmesh_copy.points, ctmesh.points))
assert (not is_same_array(ctmesh_copy.trilist, ctmesh.trilist))
assert (not is_same_array(ctmesh_copy.colours, ctmesh.colours))
assert (not is_same_array(ctmesh_copy.landmarks['test'].lms.points,
ctmesh.landmarks['test'].lms.points))
开发者ID:Amos-zq,项目名称:menpo,代码行数:16,代码来源:trimesh_copy_test.py
示例10: test_texturedtrimesh_creation_copy_true
def test_texturedtrimesh_creation_copy_true():
points = np.array([[0, 0, 0],
[1, 0, 0],
[1, 1, 0],
[0, 1, 0]])
trilist = np.array([[0, 1, 3],
[1, 2, 3]])
pixels = np.ones([10, 10, 1])
tcoords = np.ones([4, 2])
texture = Image(pixels, copy=False)
ttm = TexturedTriMesh(points, tcoords, texture, trilist=trilist,
copy=True)
assert (not is_same_array(ttm.points, points))
assert (not is_same_array(ttm.trilist, trilist))
assert (not is_same_array(ttm.tcoords.points, tcoords))
assert (not is_same_array(ttm.texture.pixels, pixels))
开发者ID:yymath,项目名称:menpo,代码行数:16,代码来源:trimish_test.py
示例11: test_LandmarkManager_get
def test_LandmarkManager_get():
lgroup = LabelledPointUndirectedGraph(points, adjacency_matrix, mask_dict)
man = LandmarkManager()
man._landmark_groups['test_set'] = lgroup
assert(man['test_set'] is lgroup)
assert is_same_array(man['test_set'].points, lgroup.points)
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:8,代码来源:landmark_test.py
示例12: test_LandmarkManager_set_LabelledPointUndirectedGraph
def test_LandmarkManager_set_LabelledPointUndirectedGraph():
lgroup = LabelledPointUndirectedGraph(points, adjacency_matrix, mask_dict)
man = LandmarkManager()
man['test_set'] = lgroup
assert not is_same_array(man['test_set'].points,
lgroup.points)
assert man['test_set']._labels_to_masks is not lgroup._labels_to_masks
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:8,代码来源:landmark_test.py
示例13: test_LandmarkManager_set_PointCloud_not_copy_target
def test_LandmarkManager_set_PointCloud_not_copy_target():
pcloud = PointCloud(points)
man = LandmarkManager()
man['test_set'] = pcloud
assert not is_same_array(man['test_set'].points,
pcloud.points)
assert_allclose(man['test_set'].points, np.ones([10, 3]))
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:8,代码来源:landmark_test.py
示例14: test_LandmarkGroup_copy_true
def test_LandmarkGroup_copy_true():
points = np.ones((10, 3))
mask_dict = {'all': np.ones(10, dtype=np.bool)}
pcloud = PointCloud(points, copy=False)
lgroup = LandmarkGroup(None, 'label', pcloud, mask_dict)
assert (not is_same_array(lgroup.lms.points, points))
assert (lgroup._labels_to_masks is not mask_dict)
assert (lgroup.lms is not pcloud)
开发者ID:dubzzz,项目名称:menpo,代码行数:8,代码来源:landmark_test.py
示例15: test_LandmarkGroup_copy_false
def test_LandmarkGroup_copy_false():
points = np.ones((10, 3))
mask_dict = OrderedDict([('all', np.ones(10, dtype=np.bool))])
pcloud = PointCloud(points, copy=False)
lgroup = LandmarkGroup(pcloud, mask_dict, copy=False)
assert (is_same_array(lgroup._pointcloud.points, points))
assert (lgroup._labels_to_masks is mask_dict)
assert (lgroup.lms is pcloud)
开发者ID:yymath,项目名称:menpo,代码行数:8,代码来源:landmark_test.py
示例16: test_LandmarkManager_set_PointCloud_not_copy_target
def test_LandmarkManager_set_PointCloud_not_copy_target():
points = np.ones((10, 3))
pcloud = PointCloud(points, copy=False)
man = LandmarkManager()
man['test_set'] = pcloud
assert (not is_same_array(man['test_set'].lms.points,
pcloud.points))
assert_allclose(man['test_set']['all'].points, np.ones([10, 3]))
开发者ID:HaoyangWang,项目名称:menpo,代码行数:9,代码来源:landmark_test.py
示例17: test_LabelledPointUndirectedGraph_add_label
def test_LabelledPointUndirectedGraph_add_label():
lgroup = LabelledPointUndirectedGraph(points, adjacency_matrix, mask_dict_2)
new_lgroup = lgroup.add_label('lower2', [0, 1])
assert not is_same_array(new_lgroup.points, lgroup.points)
lower_pcloud = new_lgroup.get_label('lower2')
assert lower_pcloud.n_points == 2
assert_allclose(lower_pcloud.points[0, :], [1., 1., 1.])
assert_allclose(lower_pcloud.points[1, :], [1., 1., 1.])
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:10,代码来源:group_test.py
示例18: test_LandmarkManager_copy_method
def test_LandmarkManager_copy_method():
pcloud = PointCloud(points)
man = LandmarkManager()
man['test_set'] = pcloud
man_copy = man.copy()
assert man_copy['test_set'] is not man['test_set']
assert not is_same_array(man_copy['test_set'].points,
man['test_set'].points)
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:10,代码来源:landmark_test.py
示例19: test_LandmarkManager_iterate
def test_LandmarkManager_iterate():
pcloud = PointCloud(points)
man = LandmarkManager()
man['test_set'] = pcloud
man['test_set2'] = pcloud
man['test_set3'] = pcloud
for l in man:
assert not is_same_array(man[l].points, pcloud.points)
assert len(man) == 3
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:11,代码来源:landmark_test.py
示例20: test_LabelledPointUndirectedGraph_copy_method
def test_LabelledPointUndirectedGraph_copy_method():
lgroup = LabelledPointUndirectedGraph(points, adjacency_matrix, mask_dict)
lgroup_copy = lgroup.copy()
assert not is_same_array(lgroup_copy.points, lgroup.points)
# Check the mask dictionary is deepcopied properly
assert lgroup._labels_to_masks is not lgroup_copy._labels_to_masks
masks = zip(lgroup_copy._labels_to_masks.values(),
lgroup._labels_to_masks.values())
for ms in masks:
assert ms[0] is not ms[1]
开发者ID:grigorisg9gr,项目名称:menpo,代码行数:11,代码来源:group_test.py
注:本文中的menpo.testing.is_same_array函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论