mask_to_submission.py 文件源码

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

项目:semantic-segmentation 作者: albertbuchard 项目源码 文件源码
def mask_to_submission_strings(image_filename):
    """Reads a single image and outputs the strings that should go into the submission file"""
    img_number = int(re.search(r"\d+", image_filename).group(0))
    im = mpimg.imread(image_filename)
    patch_size = 16
    for j in range(0, im.shape[1], patch_size):
        for i in range(0, im.shape[0], patch_size):
            patch = im[i:i + patch_size, j:j + patch_size]
            label = patch_to_label(patch)
            yield("{:03d}_{}_{},{}".format(img_number, j, i, label))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号