__getitem__方法
len
os.path.join()方法
numpy.loadtxt
ndmin
返回的数组将至少具有“ndmin”维度。否则,mono-dimensional axes will be squeezed。合法值:0(默认)、1或2。
tolist()方法
a = np.array([[1,2,3],[4,5,6],[7,8,9]])
print(a)
b = a.tolist()
print(b)
print(len(b))
[[1 2 3]
[4 5 6]
[7 8 9]]
[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
3
np.roll()
链接: https://numpy.org/doc/stable/reference/generated/numpy.roll.html
iloc[]
argsort
detach()
torch.backends.cudnn.benchmark
https://blog.csdn.net/byron123456sfsfsfa/article/details/96003317 https://blog.csdn.net/m0_46653437/article/details/110731647
enumerate
tqdm 用法, leave
torch.cuda.amp.autocast()
scale
python pytorch
set_postfix
weight_decay
torch.optim
train_eval_loader
torch.cuda.amp.GradScaler()
add_module
算法流程
1.所有框按照类划分,剔除背景 2.对于每个物体的边界框(B_BOX),按照分类置信度降序排列 3.在某一类中,选择置信度最高的边界B_BOX1,将B_BOX1从输入中取出,加入到输入列表 4.逐个计算B_BOX1与其余B_BOX2的交并比IoU,若IoU(B_BOX1,B_BOX2)>阈值TH,则在输入中移除B_BOX2(此时是与B_BOX1计算IOU) 5.在除了B_BOX1的剩下框中重复步骤3~4,直到输入列表为空,完成一个物体类的遍历。 6.重复2~5,直到所有物体类的NMS处理完成。 7.输出列表,算法结束
计算IOU
def iou(self, box1, box2):
N = box1.size(0)
M = box2.size(0)
lt = torch.max(
box1[:, :2].unsqueeze(1).expand(N, M, 2),
box2[:, :2].unsqueeze(0).expand(N, M, 2),
)
rb = torch.min(
box1[:, 2:].unsqueeze(1).expand(N, M, 2),
box2[:, 2:].unsqueeze(0).expand(N, M, 2),
)
wh = rb - lt
wh[wh < 0] = 0
inter = wh[:,:,0] * wh[:,:,1]
area1 = (box1[:,2]-box1[:,0]) * (box1[:,3]-box1[:,1])
area2 = (box2[:,2]-box2[:,0]) * (box2[:,3]-box2[:,1])
area1 = area1.unsqueeze(1).expand(N,M)
area2 = area2.unsqueeze(0).expand(N,M)
iou = inter / (area1+area2-inter)
return iou
np.unique
latex示例
Gamma公式展示
Γ
(
n
)
=
(
n
?
1
)
!
?
n
∈
N
\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N
Γ(n)=(n?1)!?n∈N 是通过 Euler integral
Γ
(
z
)
=
∫
0
∞
t
z
?
1
e
?
t
d
t
?
.
\Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,.
Γ(z)=∫0∞?tz?1e?tdt.
z
z
z
yolox
python tools/demo.py video -f exps/default/yolox_s.py -c yolox_s.pth.tar --path jianxin.mp4 --conf 0.25 --nms 0.45 --tsize 640 --save_result --device gpu
|