![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图像分割
文章平均质量分 71
smallworldxyl
这个作者很懒,什么都没留下…
展开
-
Unet++网络结构代码(pytorch)
网络结构图如下:import torchfrom torch import nnimport torch.nn.functional as Ffrom torch.utils.tensorboard import SummaryWriterclass VGGBlock(nn.Module): def __init__(self, in_channels, middle_channels, out_channels): super().__init__()原创 2021-11-28 14:33:33 · 10510 阅读 · 2 评论 -
【语义分割】评价指标:PA、CPA、MPA、IoU、MIoU详细总结和代码实现
文章目录 引言1 混淆矩阵2 语义分割PA:像素准确率CPA:类别像素准确率MPA:类别平均像素准确率IoU:交并比MIoU:平均交并比 3 综合实例步骤一:输入真实、预测图片步骤二:求出混淆矩阵步骤三:评价指标计算PACPAMPAIoUMIoU 4 测试代码参...转载 2021-11-26 23:18:23 · 15507 阅读 · 7 评论 -
Unet代码详解(三)损失函数和miou计算
所有代码来自博主Bubbliiiing,十分感谢1.相关函数(1)上采样函数Interpolate(2)交叉熵损失函数CrossEntropyLoss二.损失先贴一段训练时的损失计算代码import torchimport torch.nn as nnimport torch.nn.functional as Ffrom torch import nndef CE_Loss(inputs, target, cls_weights, num_classes=21): n,原创 2021-11-26 22:57:27 · 14884 阅读 · 4 评论 -
从零手写Unet代码及数据
数据集资源已上传,不需要积分。一.网络模型(model.py)import torchimport torch.nn as nnimport torchvision.transforms.functional as TFclass DoubleConv(nn.Module): def __init__(self,in_channels,out_channels): super(DoubleConv, self).__init__() self.conv=.原创 2021-11-25 14:13:52 · 2027 阅读 · 0 评论 -
Unet代码详解(二)数据预处理和后处理
import osimport cv2import numpy as npfrom PIL import Imagefrom torch.utils.data.dataset import Datasetfrom utils.utils import cvtColor, preprocess_inputclass UnetDataset(Dataset): def __init__(self, annotation_lines, input_shape, num_classes,原创 2021-11-21 16:28:06 · 6648 阅读 · 2 评论 -
Unet代码解读(一)网络架构
文章代码来自博主Bubbliiiing,特此感谢。一.网络总览二. VGG16主干提取网络文章采用VGG16作为主干提取网络,只会用到两种类型的层,分别是卷积层和最大池化层。代码对部分层进行了改动,详情可见下方网络结构,可参考下图作为理解完整代码如下:1.vggnetimport torchimport torch.nn as nnfrom torchvision.models.utils import load_state_dict_from_urlclass VGG(nn.Mo原创 2021-11-21 15:37:59 · 3794 阅读 · 2 评论 -
语义分割指标---MIoU详细介绍(原理及代码)
一.IOU理解在语义分割的问题中,交并比就是该类的真实标签和预测值的交和并的比值单类的交并比可以理解为下图:TP: 预测正确,真正例,模型预测为正例,实际是正例FP: 预测错误,假正例,模型预测为正例,实际是反例FN: 预测错误,假反例,模型预测为反例,实际是正例TN: 预测正确,真反例,模型预测为反例,实际是反例IoU = TP / (TP + FN + FP)二.MIoUMIOU就是该数据集中的每一个类的交并比的平均,计算公式如下:Pij表示将i类别预测为j类别。三.混淆原创 2021-11-18 16:46:26 · 48865 阅读 · 10 评论