有两个轮廓的关键点回归失败?
来自:300W转yolo格式出问题
比如:coco2yolo
0 xywh (px,py, flag) (px,py, flag) (px,py, flag)
而300W2yolo:
0 xywh (px,py) (px,py) (px,py)
还是要手动添加flag,全部设置为2. 但在实际数据处理中,flag已经被清理,数据处理不存在问题。
https://github.com/WongKinYiu/yolov7/pull/501
https://github.com/TexasInstruments/edgeai-yolov5/issues/10
在计算OKS时,我们定制了每个点的偏差,但按照如此训练,并没有明显的性能提升。如下:
Our falloff:
[0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18, 0.18,
0.116, 0.116, 0.116, 0.116, 0.116, 0.116,0.116, 0.116,0.116, 0.116,
0.103, 0.103, 0.103, 0.103,
0.072, 0.072, 0.072, 0.072, 0.072,
0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085, 0.085,
0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103, 0.103,
0.11, 0.101, 0.101, 0.101, 0.11,
0.101, 0.101, 0.101]
[ [ -1, 1, Conv, [ 768, 1, 1 ] ],
[ -1, 1, nn.Upsample, [ None, 2, 'nearest' ] ],
#将以上两个模块合并成反卷即模块
[ [ -1, 1, DeConv, [ 768, 1, 1 ] ],
# [ [ -1, 20 ], 1, Concat, [ 1 ] ], # cat head P4
[ [ -1, 18 ], 1, Concat, [ 1 ] ], # cat head P4
# 原来将第20层连接到一起,现在由于减少来2层故对应修改层数
在common.py中添加如下模块Deconv,在yolo.py也需要添加对应的DeConv模块
class DeConv(nn.Module):
# Standard convolution
#(k, p, outp) = (4,1,0) (3,1,1) (2,0,0)
def __init__(self, c1, c2, k=3, s=2, p=1, g=1, act=True): # ch_in, ch_out, kernel, stride, padding, groups
super(DeConv, self).__init__()
self.deconv = nn.ConvTranspose2d(c1, c2, k, s,
padding= p,
output_padding=p,
groups=g, bias=False)
self.bn = nn.BatchNorm2d(c2)
if act != "ReLU":
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
else:
self.act = nn.ReLU(inplace=True)
def forward(self, x):
return self.act(self.bn(self.deconv(x)))
def fuseforward(self, x):
return self.act(self.deconv(x))
将会持续更新我们的改进过程……