eval_instance_segmentation_coco.py 文件源码

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

项目:chainer-fcis 作者: knorth55 项目源码 文件源码
def _create_ann(whole_m, lbl, sc, img_id, ann_id, crw=None, ar=None):
    H, W = whole_m.shape
    if crw is None:
        crw = False
    whole_m = np.asfortranarray(whole_m.astype(np.uint8))
    rle = mask_tools.encode(whole_m)
    # Surprisingly, ground truth ar can be different from area(rle)
    if ar is None:
        ar = mask_tools.area(rle)
    ann = {
        'image_id': img_id, 'category_id': lbl,
        'segmentation': rle,
        'area': ar,
        'id': ann_id,
        'iscrowd': crw}
    if sc is not None:
        ann.update({'score': sc})
    return ann
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号