File tree 1 file changed +21
-0
lines changed 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -208,4 +208,25 @@ yolov5采用dataloader进行测试时候,实际上是有自适应的,虽然
208
208
可以看出yolov5这种设置会更好一点。应该就是这个差异导致的mAP不一样。
209
209
210
210
211
+ 关于yolov5中心点解码问题的分析:
212
+ yolov5中是:
213
+ x_center_pred = (pred_bboxes[ ..., 0] * 2. - 0.5 + grid[ :, 0] ) * stride # xy
214
+ y_center_pred = (pred_bboxes[ ..., 1] * 2. - 0.5 + grid[ :, 1] ) * stride # xy
211
215
216
+ pred_bboxes的xy是相对网格左上角的偏移,而mmdetection中anchor是相对网格中心,以x方向为例
217
+ (x* 2-0.5+grid_x)* s
218
+ = (x* 2-0.5)* s+grid_x* s # yolov5
219
+ = (x* 2-0.5)* s+(xcenter/s-0.5)* s
220
+ = (x-0.5)* 2* s+xcenter # mmdetection
221
+
222
+
223
+ 关于yolov4的scale_xy,中心点解码问题的分析:
224
+ yolov4中是:
225
+ x_center_pred = (pred_bboxes[ ..., 0] * self.scale_x_y - 0.5 * (self.scale_x_y - 1) + grid[ :, 0] ) * stride # xy
226
+
227
+ pred_bboxes的xy是相对网格左上角的偏移,而mmdetection中anchor是相对网格中心,以x方向为例
228
+
229
+ (x* 1.05-0.5(1.05-1)+grid)* s
230
+ = (x* 1.05-0.5(1.05-1))* s+grid_x* s
231
+ = (x* 1.05-0.5(1.05-1))* s+(xcenter/s-0.5)* s
232
+ = (x* 1.05-0.5(1.05-1)-0.5)* s+xcenter
You can’t perform that action at this time.
0 commit comments