github链接
detectron2中的模型可由build_model, build_backbone, build_roi_heads来创建:

from detectron2.modeling import build_model
model = build_model(cfg)  # returns a torch.nn.Module

来看看,构建模型需要的输入输出。

Model Input Format

DatasetMapper的输出是一个字典格式,data loader是批操作的,所以准确来说,这里的输出是 list[dict],一张图一个字典,这就是构建模型的输入。

字典包含如下关键字:

  • "image": Tensor in (C, H, W) format.

  • "instances": an Instances object, with the following fields:#实例,有如下字段:

    • "gt_boxes": Boxes object storing N boxes, one for each instance.#框
    • "gt_classes": Tensor, a vector of N labels, in range [0, num_categories).#类别
    • "gt_masks": a PolygonMasks object storing N masks, one for each instance.#掩码
    • "gt_keypoints": a Keypoints object storing N keypoint sets, one for each instance.#关键点
  • "proposals": an Instances object used in Fast R-CNN style models, with the following fields:#模型Fast RCNN的实例有如下字段:

    • "proposal_boxes": Boxes object storing P proposal boxes.#建议框
    • "objectness_logits": Tensor, a vector of P scores, one for each proposal.#每个框的得分值
  • "height", "width": the desired output height and width of the image, not necessarily the same as the height or width of the image when input into the model, which might be after resizing. For example, it can be the original image height and width before resizing.#原图大小,不是进入模型的图片大小

如果提供"height", "width"参数,模型会反馈同样分辨率的输出,而不是返回与模型输入同规模的结果,这样更高效,也更准确。

  • "sem_seg": Tensor[int] in (H, W) format. The semantic segmentation ground truth.#语义分割真值

Model Output Format

标准模型输出list[dict],一个字典表示一张图像。每个地点包含如下内容:

  • "instances": Instances object with the following fields:#每个实例对象的参数

    • "pred_boxes": Boxes object storing N boxes, one for each detected instance.#框
    • "scores": Tensor, a vector of N scores.#得分值
    • "pred_classes": Tensor, a vector of N labels in range [0, num_categories).#检测类别
    • "pred_masks": a Tensor of shape (N, H, W), masks for each detected instance.#检测实例的结果掩码
    • "pred_keypoints": a Tensor of shape (N, num_keypoint, 3). Each row in the last dimension is (x, y, score).#检测关键点,最后一个维度是点坐标和得分
  • "sem_seg": Tensor of (num_categories, H, W), the semantic segmentation prediction.#语义分割
  • "proposals": Instances object with the following fields:#实例对象有如下字段
    • "proposal_boxes": Boxes object storing N boxes.#框
    • "objectness_logits": a torch vector of N scores.
  • "panoptic_seg": A tuple of (Tensor, list[dict]). The tensor has shape (H, W), where each element represent the segment id of the pixel. Each dict describes one segment id and has the following fields:#全景分割模型,每个字典表示一个全景分割,有如下字段:
    • "id": the segment id
    • "isthing": whether the segment is a thing or stuff
    • "category_id": the category id of this segment. It represents the thing class id when isthing==True, and the stuff class id otherwise.

Use Models相关推荐

  1. 编译ONNX模型Compile ONNX Models

    编译ONNX模型Compile ONNX Models 本文是一篇介绍如何使用Relay部署ONNX模型的说明. 首先,必须安装ONNX包. 一个快速的解决方案是安装protobuf编译器,然后 pi ...

  2. Cannot find snapshot in models/VGGNet/VOC0712/SSD_300x300

    错误描述: 执行 python examples/ssd/ssd_pascal.py 报错: Cannot find snapshot in models/VGGNet/VOC0712/SSD_300 ...

  3. tensorflow models 工程解析

    项目地址:https://github.com/tensorflow/models 下面列表中的是否支持 tf2.0 来源于 https://github.com/tensorflow/models/ ...

  4. 三维植物树木模型 Maxtree – Plant Models Vol 74

    maxtree–工厂模型第74卷 大小解压后:2.34G 信息: 植物模型第74卷是高质量的三维植物模型的集合.包括12个物种,共72个单一模式. 获取地址:三维植物树木模型 Maxtree – Pl ...

  5. 藤本植物和攀爬植物模型包 Globe Plants – Bundle 23 – Vines and Creepers 03 (3D Models)

    藤本植物和攀爬植物模型包 Globe Plants – Bundle 23 – Vines and Creepers 03 (3D Models) 全球植物–第23束–藤本植物和攀缘植物03 (3D模 ...

  6. ORM操作models一对多、多对多关系

    ORM操作 单表.一对多表操作 1 from django.db import models 2 3 4 class UserGroup(models.Model): 5 title = models ...

  7. AttributeError: Cant get attribute SPPF on module models

    运行YOLOV5出现报错AttributeError: Can't get attribute 'SPPF' 问题 AttributeError: Can't get attribute 'SPPF' ...

  8. ant models 内获取 url 的参数传递到组件

    models代码: import { getCList} from "@/services/api"; import { MessageTip } from '@/utils/to ...

  9. DSSM(DEEP STRUCTURED SEMANTIC MODELS)

    Huang, Po-Sen, et al. "Learning deep structured semantic models for web search using clickthrou ...

  10. YII2 models非常好用的控制输出数据【重写Fields】

    models里重写Fields真的很好用,用于分类.评论功能 列子:评论表models/Comment.php 1.关联商品表 2.获取父级(即管理员)评论 public function Field ...

最新文章

  1. rust矿洞绳子怎么爬下_车底下绑一根绳子妙用在哪?看看老司机怎么说!
  2. 【C++】Google Protocol Buffer(protobuf)详解(一)
  3. QDoc包括图片includingimages
  4. URL中允许携带sessionid带来的安全隐患。
  5. eclipse maven项目 class类部署不到tomcat下_Servlet tomcat部署
  6. java中 将字符串时间 '2015-9-8 17:05:06' 转化为格式 '2015-09-08 17:05:06'
  7. python利用什么写模块_python模块是什么?写法及作用分析
  8. Android 开发常用ADB命令集合
  9. Vuforia+Unity实现AR效果
  10. ML-Agents案例之推箱子游戏
  11. 无法启动程序因为计算机中丢失msvcr100,devenv.exe 系统错误无法启动此程序,因为计算机中丢失 MSVCR100.dll问题的解决办法...
  12. 台式计算机套什么定额,计算机电缆套定额
  13. 免费P2P穿透通信(4) RDT可靠通信模块测试使用
  14. javascript网页设计期末作业 购物网站
  15. 世界四大红茶及中国十大名茶
  16. php账单明细功能怎么实现,php 处理微信账单
  17. 现在爆火的数字孪生城市,到底是什么技术?
  18. JS base64编码解码实战
  19. NETCONF配置CISCO XE(csr1000v)初体验
  20. Python:1014 福尔摩斯的约会

热门文章

  1. 计算机科学与技术专业导向ppt,计算机科学与技术专业导向讲座 第3讲.ppt
  2. html获取鼠标选中文本,经过JS获得input输入框中用鼠标选中的内容
  3. 中老铁路运营一周年:磨憨口岸打造口岸智慧化新模式
  4. 安装nodejs报错2503
  5. 常用正则表达式大全(校验数字,字符,号码等)
  6. 如何在Tableau中的县级上映射数据
  7. Vue美食杰首页项目
  8. 关于使用idea在maven项目中出现Error:java: Annotation processing is not supported for module cycles.Pleas的问题解决方法
  9. 以快制胜:跨境电商依靠三大支柱和边缘计算换挡进入跑车道(下篇)
  10. 用谷歌浏览器模拟手机访问