keras Mask Rcnn代码走读(九)-detect方法介绍

本文详细解析了Keras Mask R-CNN中detect方法的实现过程,包括图像预处理、锚点生成、模型预测以及结果还原到原始图像的步骤,重点介绍了如何进行实体分割的推断。
摘要由CSDN通过智能技术生成

keras Mask Rcnn代码走读(八)-detect方法介绍,主要用于图片实体分割的推断时调用的。
一,首先对图像进行处理,调用self.mold_inputs()函数,把原图等比例resize成102410243的图像,不够的地方用0填充,同时减去图像平均值。并记录原图的位置及大小信息在image_metas里, molded_images处理后的图像。windows为原图在处理后图片的对角像素坐标。

def detect(self, images, verbose=0):
    """Runs the detection pipeline.

    images: List of images, potentially of different sizes.

    Returns a list of dicts, one dict per image. The dict contains:
    rois: [N, (y1, x1, y2, x2)] detection bounding boxes
    class_ids: [N] int class IDs
    scores: [N] float probability scores for the class IDs
    masks: [H, W, N] instance binary masks
    """
    assert self.mode == "inference", "Create model in inference mode."
    assert len(
        images) == self.config.BATCH_SIZE, "len(images) must be equal to BATCH_SIZE"

    if verbose:
        log("Proce
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值