模型训练与过程学习

输出解析

分类头

 class_head的网络定义如下,head_conv参数为256,输入features的大小为(1,64,96,320),经过class_head之后的输出(1,3,96,320),输入图像的高度和宽度保持不变

self.class_head = nn.Sequential(
            nn.Conv2d(in_channels,
                      head_conv, #输出通道数
                      kernel_size=3,
                      padding=1,),
            group_norm(head_conv),
            nn.ReLU(inplace=True),
            nn.Conv2d(head_conv,  #用于降低输出通道数
                      classes,
                      kernel_size=1,
                      padding=0,)
        )
 #调用
 head_class = self.class_head(features)
 head_class = sigmoid_hm(head_class)
#可视化热度图
        heatmap_img = heatmap.to(torch.device("cpu"))
        image = heatmap_img.squeeze().permute(1, 2, 0).numpy()  # 移除批次维度和通道维度,并将通道维度移到最后
        plt.imshow(image)
        plt.show()

head_class
在这里插入图片描述sigmoid_hm之后
在这里插入图片描述
nms_hm之后在这里插入图片描述 上述显示的是3个通道合在一起的图像结果,下面还是以测试数据集中编号000000.jpg数据集为例,分别展示其原图,三通道热度图以及三个单通道图
在这里插入图片描述三通道数据融合
在这里插入图片描述通道0
在这里插入图片描述通道1
在这里插入图片描述通道2
在这里插入图片描述

head_class = sigmoid_hm(head_class)
        heatmap_img = head_class.to(torch.device("cpu"))
        image = heatmap_img.squeeze().permute(1, 2, 0).numpy()  # 移除批次维度和通道维度,并将通道维度移到最后
        plt.imshow(image)
        plt.show()
        #分别显示单通道
        for i in range(0, 3):
            heatmap = head_class[0][i]
            heatmap_img = heatmap.to(torch.device("cpu"))
            image = heatmap_img.numpy()
            plt.imshow(image)
            plt.show()

focal_loss

 根据论文所参考的corner_net网络,其对原始标注数据进行了预处理,首先是将目标中心进行高斯化处理

import cv2
import numpy as np
import matplotlib.pyplot as plt

shape =(200,200)
sigma = 20/6
# sigma  高斯分布的标准差 控制了高斯分布的宽度
m, n = [(ss - 1.) / 2. for ss in shape]
for ss in shape:
    print("ss:",ss)
print("m:",m,"n:",n,)
# 使用 np.ogrid 创建了两个二维数组 y 和 x,用于生成坐标网格
y, x = np.ogrid[-m:m+1,-n:n+1]
h = np.exp(-(x * x + y * y) / (2 * sigma * sigma))
# 对h进行截断操作
h[h < np.finfo(h.dtype).eps * h.max()] = 0
#可视化h
# cv2.namedWindow("enhanced",0);
# cv2.resizeWindow("enhanced", 640, 480);
# cv2.imshow("enhanced",h)
# cv2.waitKey(0)
#可视化h片段
x = np.linspace(-5, 5, 20)
plt.plot(x,h[100].unsequzee(-1), label='Gaussian Distribution')
plt.xlabel('x')
plt.ylabel('Probability Density')
plt.title('Gaussian Distribution')
plt.legend()
plt.grid(True)
plt.show()

深度线索 (以下图片均以000009.jpg作为输入)

在这里插入图片描述

深度线索模块的输出
在这里插入图片描述
深度回归头的输出
在这里插入图片描述

回归头一 center2d_wh_reg

该头的输出包括 △ u 2 d , △ v 2 d , w , h \bigtriangleup _{u2d} ,\bigtriangleup_{v2d},w,h u2d,v2d,w,h
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述在这里插入图片描述

POI(感兴趣点)在图像上的反映

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

摸鱼带师小弟

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值