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))
mask_to_submission.py 文件源码
python
阅读 17
收藏 0
点赞 0
评论 0
评论列表
文章目录