-
Notifications
You must be signed in to change notification settings - Fork 0
/
NMS的使用.drawio
70 lines (70 loc) · 9.86 KB
/
NMS的使用.drawio
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<mxfile host="app.diagrams.net" modified="2023-03-27T03:10:59.722Z" agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 Edg/112.0.0.0" etag="BYJP8hbq-B42BuZu3hsC" version="21.1.1" type="github">
<diagram id="cp2CzAZKEZPghFZQ-joy" name="第 1 页">
<mxGraphModel dx="1888" dy="980" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1200" pageHeight="1920" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="iZZFebuZpYIs87GABAeR-6" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=18;fontStyle=0" parent="1" vertex="1">
<mxGeometry x="70" y="20" width="550" height="580" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-1" value="<font style="font-size: 18px;">rcnn 311<br>self.proposal_generator</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="205" y="110" width="280" height="60" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-2" value="<font style="font-size: 18px;">ubteacher modeling rpn.py 61<br>proposals = self.predict_proposals</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="150" y="200" width="390" height="60" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-3" value="<font style="font-size: 18px;">d2 modeling proposal_generator rpn.py 504<br>find_top_rpn_proposals<br>RPN的采样时从anchor中采样<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="112.5" y="290" width="465" height="70" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-4" value="<font style="font-size: 18px;">d2 modeling proposal_generator prpposal_utils.py 122<br>batched_nms<br>先计算损失,再NMS<br>这里的NMS有点特殊,RPN的分数是直接使用未激活的<br>RPN使用原本的NMS,但是ROI的使用自定义的NMS<br>还有一点需要强调,RPN 计算损失的时候没有NMS<br>&nbsp;而是对带0和1标签的样本进行了损失的计算<br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="88" y="390" width="514" height="160" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-7" value="RPN" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Helvetica;fontSize=27;fontStyle=0" parent="1" vertex="1">
<mxGeometry x="315" y="50" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-8" value="" style="rounded=0;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontSize=18;fontStyle=0" parent="1" vertex="1">
<mxGeometry x="666" y="20" width="520" height="1750" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-9" value="<span style="font-size: 18px;">ubteacher modeling roi_heads&nbsp;<br>输入2000个经过NMS之后的proposals</span>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="761" y="101" width="335" height="100" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-10" value="<span style="font-size: 18px;">ubteacher modeling roi_heads 83行</span><span style="font-size: 18px;"><br>label_and_sample_proposals<br>对2000个proposals 取样512个<br>128个正样本 384个负样本<br></span>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="736" y="221" width="390" height="100" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-13" value="ROI" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontFamily=Helvetica;fontSize=27;fontStyle=0" parent="1" vertex="1">
<mxGeometry x="896" y="50" width="60" height="30" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-14" value="<font style="font-size: 18px;">ubteacher modeling roi_heads 164行<br>self.proposal_matcher(match_quality_matrix)<br>计算和Ground truth IOU, 值大于0.5的作为正样本<br><font style="font-size: 18px;" color="#ff3333">RPN 和 ROI 都有采样的做法<br>但是RPN是阈值设为0.7 计算损失<br>ROI 是设置0.5作为阈值<br></font><font style="font-size: 18px;" color="#ff3333">matched_labels 只包含 0和1</font><br>返回的参数分别包括IOU最大的ID,以及正负样本的标签</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="696" y="351" width="470" height="219" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-15" value="<span style="font-size: 18px;">ubteacher modeling roi_heads 167行</span><br><span style="font-size: 18px;">self._sample_proposals()<br>从正样本中挑选128个作为正样本</span><br><span style="font-size: 18px;">从负样本中挑选384个作为负样本</span>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="698.5" y="580" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-16" value="<span style="font-size: 18px;">ubteacher modeling roi_heads 180行</span><br><span style="font-size: 18px;">proposals_per_image.set<br>将gt_boxes 加到proposal中去<br>返回512个proposals<br></span>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="696" y="730" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-17" value="<span style="font-size: 18px;">ubteacher modeling roi_heads 103行</span><br><span style="font-size: 18px;">self._forward_box</span><br>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="698.5" y="880" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-18" value="<font style="font-size: 18px;">ubteacher modeling roi_heads 103行<br>self.box_pooler<br>self.box_head<br>self.box_predictor</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="693.49" y="1030" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-19" value="<span style="font-size: 18px;">ubteacher modeling roi_heads fast_rcnn 245行<br></span><p><font style="font-size: 18px;">计算512个proposal的类别分数</font></p>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="693.5" y="1320" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-20" value="<font style="font-size: 18px;">ubteacher modeling roi_heads 128行<br>self.box_pooler<br>self.box_head<br>self.box_predictor</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="693.49" y="1180" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-21" value="<span style="font-size: 18px;">ubteacher modeling roi_heads fast_rcnn 128行<br></span><p><font style="font-size: 18px;">计算512个proposal中正样本的回归损失</font></p><p><font style="font-size: 18px;">那么就是说ROI计算损失的时候依然用不到NMS</font></p>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="698.5" y="1470" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-22" value="<font style="font-size: 18px;">ubteacher modeling roi_heads 103行<br>self.box_pooler<br>self.box_head<br>self.box_predictor</font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="698.5" y="1620" width="470" height="120" as="geometry" />
</mxCell>
<mxCell id="iZZFebuZpYIs87GABAeR-23" value="<font style="font-size: 18px;"><font color="#ff6666">总结一下,proposal和roi在计算损失的时候都不会用到NMS,而proposal在给roi提供proposal的时候用到了<br>并且teacher模型给student模型提供伪标签用到了<br>在模型最后的计算map时用到了</font><br></font>" style="rounded=1;whiteSpace=wrap;html=1;fontFamily=Helvetica;fontStyle=0;" parent="1" vertex="1">
<mxGeometry x="86" y="622" width="514" height="160" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>