test_auxiliary_methods.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:LabelsManager 作者: SebastianoF 项目源码 文件源码
def test_binarise_a_matrix():

    in_data = np.array([0, 1, 2, 3, 4])
    expected_out_data = np.array([0, 1, 1, 1, 1])
    assert_array_equal(expected_out_data, binarise_a_matrix(in_data, dtype=np.int))


# def test_get_values_below_label():
#
#     image = np.array(range(8 * 8)).reshape(8, 8)
#     mask = np.zeros_like(image)
#     mask[2, 2] = 1
#     mask[2, 3] = 1
#     mask[3, 2] = 1
#     mask[3, 3] = 1
#     vals = get_values_below_label(image, mask, 1)
#     assert_array_equal([image[2, 2], image[2, 3], image[3, 2], image[3, 3]], vals)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号