run_FCN.py 文件源码

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

项目:semantic-segmentation 作者: albertbuchard 项目源码 文件源码
def save_rotated_test_images():
    #
    #   DESCRIPTION 
    #       This function rotates the test image and create four patches of 400 * 400
    #       It then saves those 32 images in the test_set_images folder of each image 
    #   
    #

    # Loop over all images 
    for i in range(1,51):
        # Load image
        image = mpimg.imread('test_set_images/test_'+str(i)+'/test_'+str(i)+'.png')
        rotations = mk_rotations(image)
        rota_count = 0
        for rotation in rotations:
            patches = make_4_patch(rotation)
            patch_count = 0
            for patch in patches:
                patch = format_image(patch)
                Image.fromarray(patch).save('test_set_images/test_'+str(i)+'/Test_'+str(i)+'_rota'+str(rota_count)+'_patch'+str(patch_count)+'.png')
                patch_count += 1
            rota_count+=1


        print('Writing image ',i)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号