网络原始输出
output=torch.cat([reg_output,obj_output.sigmoid(),cls_output.sigmoid()],1)
size: torch.Size([1, 23625, 6])
- 1是batch维度
- 23625是结果数量,不同层特征图的grid单元总数
- 6对应输出[x,y,w,h,obj,cls]
demo输出
在官方的demo代码中,结果经过了后处理,输出结果为一个列表
outputs = [tensor([[ 6.8627e+02...ackward0>)]
outputs[0] =
tensor([[ 6.8627e+02, 2.4433e+02, 8.2713e+02, 6.3706e+02, 9.9891e-01,
9.5560e-01, 0.0000e+00],
[ 3.9175e+02, 2.7812e+02, 4.6796e+02, 4.9000e+02, 9.9802e-01,
9.4998e-01, 0.0000e+00],
[ 4.7491e+02, 2.6894e+02, 6.3671e+02, 7.3143e+02, 9.9751e-01,
9.5015e-01, 0.0000e+00],
[ 3.0302e+02, 2.8112e+02, 3.8625e+02, 4.9150e+02, 9.9783e-01,
9.4418e-01, 0.0000e+00],
[ 1.1320e+03, 2.3938e+02, 1.2314e+03, 4.8684e+02, 9.9645e-01,
9.4138e-01, 0.0000e+00],
[ 3.6814e+01, 2.6460e+02, 1.2008e+02, 4.6737e+02, 9.9701e-01,
9.4038e-01, 0.0000e+00],
[ 1.2432e+03, 2.6789e+02, 1.3237e+03, 4.7605e+02, 9.9576e-01,
9.3546e-01, 0.0000e+00],
[-8.3586e-02, 3.2619e+02, 6.1085e+01, 4.6840e+02, 9.9744e-01,
9.2520e-01, 0.0000e+00],
[ 4.3638e+02, 2.7471e+02, 4.9260e+02, 4.2946e+02, 9.9574e-01,
9.2373e-01, 0.0000e+00],
[ 1.0945e+03, 2.4199e+02, 1.1606e+03, 4.2709e+02, 9.9511e-01,
8.9923e-01, 0.0000e+00],
[ 1.1426e+02, 3.0380e+02, 1.7058e+02, 4.6495e+02, 9.9303e-01,
8.9652e-01, 0.0000e+00],
[ 6.5720e+02, 2.5148e+02, 7.2053e+02, 4.2820e+02, 9.9336e-01,
8.8630e-01, 0.0000e+00],
[ 2.7073e+02, 2.8161e+02, 3.1013e+02, 3.8078e+02, 9.7686e-01,
8.8360e-01, 0.0000e+00],
[ 8.1564e+00, 2.7415e+02, 5.2220e+01, 3.9116e+02, 9.9395e-01,
8.6715e-01, 0.0000e+00],
[ 8.5601e+02, 2.6363e+02, 9.1256e+02, 4.2346e+02, 9.8111e-01,
8.6075e-01, 0.0000e+00],
[ 2.2775e+02, 2.7339e+02, 2.6607e+02, 3.8977e+02, 9.8500e-01,
8.5654e-01, 0.0000e+00],
[ 1.5804e+02, 2.8275e+02, 1.8711e+02, 3.6177e+02, 9.6338e-01,
8.5498e-01, 0.0000e+00],
[ 1.9708e+02, 2.7264e+02, 2.2979e+02, 3.7127e+02, 9.4627e-01,
8.1565e-01, 0.0000e+00],
[ 8.0344e+02, 2.5964e+02, 8.6070e+02, 4.1845e+02, 8.3828e-01,
9.1158e-01, 0.0000e+00],
[-6.3595e+00, 2.7873e+02, 2.1084e+01, 3.6418e+02, 9.3673e-01,
8.1081e-01, 0.0000e+00],
[ 1.8374e+02, 2.8833e+02, 2.0989e+02, 3.6705e+02, 8.8031e-01,
8.2443e-01, 0.0000e+00],
[ 3.1365e+02, 2.7549e+02, 3.4552e+02, 3.6257e+02, 9.1754e-01,
7.8790e-01, 0.0000e+00],
[ 5.7619e+02, 2.6232e+02, 6.8083e+02, 6.1091e+02, 6.7481e-01,
8.2714e-01, 0.0000e+00],
[ 9.7696e+01, 2.8851e+02, 1.2155e+02, 3.5633e+02, 6.1227e-01,
7.4170e-01, 0.0000e+00],
[ 3.7402e+02, 2.6915e+02, 4.1399e+02, 3.8024e+02, 4.9557e-01,
7.4468e-01, 0.0000e+00],
[ 1.3349e+03, 2.5904e+02, 1.3920e+03, 4.2326e+02, 4.2641e-01,
7.8941e-01, 0.0000e+00]], device='cuda:0', grad_fn=<IndexBackward0>)
outputs[0].shape = torch.Size([26, 7])
结果格式为[left,top,right,bottom,obj_conf,cls_conf,cls_id]
outputs[0][0] = tensor([686.2659, 244.3278, 827.1260, 637.0627, 0.9989, 0.9556, 0.0000],
标签:02,输出,00,01,03,YOLOX,0.0000,格式,cls
From: https://www.cnblogs.com/zxyfrank/p/17005261.html