pytorch的mask-rcnn的模型参数解释

输入图像1920x1080,batch_size=8为例.

训练阶段

loss_dict = model(images,targets)

  • 入参
    • images: List(Tensor(3,1920,1080))[8]
    • targets: List(dict()[3])[8] dict详情见下表:
key type dtype size remark
boxes Tensor float32 (n,4)1 the ground-truth boxes in [x1, y1, x2, y2] format, with 0 <= x1 < x2 <= W and 0 <= y1 < y2 <= H.
labels Tenosr int64 (n,) the class label for each ground-truth box
maskes Tensor uint8 (n,1920,1080)[N,H,W] the segmentation binary masks for each instance,实际就是0和1,有对象的区域就是1,否则就是0,这个照片有多少个对象就有多少个mask
area* Tensor float32 (n,) 对象面积
iscrowd* Tensor int64 (n,) 是否为一群对象(coco数据集会标注)
image_id* int 图像编号

*为非必要参数,有一些数据集合处理的时候会标注上去*

  • 返回 loss_dict dict()[5] dict详情见下表:
key type dtype size 损失函数 remark
loss_classifer Tensor float32 () CrossEntropyLoss 对象分类损失(Classification Loss):
loss_box_reg Tensor float32 () Smooth L1 Loss/MSE 边界框回归损失(Bounding Box Regression Loss):
loss_mask Tensor float32 () Binary Cross-Entropy Loss 掩膜损失(Mask Loss):
loss_objectness Tensor float32 () CrossEntropyLoss RPN分类损失(RPN Classification Loss):前景/背景二分类损失
loss_rpn_box_reg Tensor float32 () Smooth L1/MSE RPN边界框回归损失(RPN Bounding Box Regression Loss)

推理阶段

predict = model(images)

  • 入参 images: List(Tensor(3,1920,1080))[8] 不变
  • 返回 predict:List(dict()[4])[8] dict详情见下表:
key type dtype size remark
boxes Tensor float32 (m,4)2 the predicted boxes in [x1, y1, x2, y2] format,预测的所有的边界框
labels Tensor int64 (m,) the predicted labels for each instance
boxes Tensor float32 (m,) the scores or each instance
boxes Tensor float32 (m,1,1920,1080)[M, 1, H, W] the predicted masks for each instance, in 0-1 range. In order to obtain the final segmentation masks, the soft masks can be thresholded, generally with a value of 0.5 (mask >= 0.5).实际存储的是一个软掩膜,0.5以下的也有,存在比较平滑的过度

参考官方文档
maskrcnn_resnet50_fpn


  1. n为此图像上的实例个数 ↩︎

  2. m为此图像 ↩︎

相关推荐

  1. pytorchmask-rcnn模型参数解释

    2024-04-23 07:16:04       38 阅读
  2. MASK-RCNN自定义数据集优化思路(pytorch)

    2024-04-23 07:16:04       30 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-23 07:16:04       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-23 07:16:04       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-23 07:16:04       82 阅读
  4. Python语言-面向对象

    2024-04-23 07:16:04       91 阅读

热门阅读

  1. 构造函数及es6类写单例模式

    2024-04-23 07:16:04       38 阅读
  2. paddlepaddle/paddle 命令注入漏洞复现_$1500 CVE-2024-0934

    2024-04-23 07:16:04       39 阅读
  3. 新技术应用塑造未来景展望

    2024-04-23 07:16:04       31 阅读
  4. PaddleSeg数据集的准备

    2024-04-23 07:16:04       36 阅读
  5. python与PySpark

    2024-04-23 07:16:04       32 阅读
  6. C++笔记打卡第15天(函数模版)

    2024-04-23 07:16:04       39 阅读
  7. Python网络爬虫项目开发实战:怎么解决数据抓取

    2024-04-23 07:16:04       34 阅读
  8. 蓝桥杯 BASIC-22 基础练习 FJ的字符串

    2024-04-23 07:16:04       32 阅读
  9. go语言学习

    2024-04-23 07:16:04       31 阅读
  10. Golang net/http 标准库源码学习

    2024-04-23 07:16:04       30 阅读
  11. 【嵌入式学习】ARM day04.16

    2024-04-23 07:16:04       39 阅读
  12. c++计算DNA探针的熔解温度

    2024-04-23 07:16:04       36 阅读
  13. MapReduce——数据切片与MapTask并行度决定机制

    2024-04-23 07:16:04       36 阅读
  14. 代码随想录:链表

    2024-04-23 07:16:04       39 阅读