Skip to content

Commit

Permalink
第33行中关于锚框宽度的论述需要修改。 (d2l-ai#1190)
Browse files Browse the repository at this point in the history
结论是宽度应为hs*sqrt(r),而非ws*sqrt(r)。

建议查看代码,multibox_prior函数中定义了w=s*sqrt(r)*h/w, h=s/sqrt(r),实际使用show_bboxes函数的时候乘上了bbox_scale=torch.tensor((w, h, w, h))。也就是说,实际生成的锚框的宽度应为s*sqrt(r)*h/w*w=hs*sqrt(r),高度为h*s/sqrt(r),锚框的实际宽高比就为r。希望可以帮助大家理解!这一节的难度很大,但是在此出错会在很大程度上阻碍大家理解!
  • Loading branch information
ClancyCC committed Dec 4, 2022
1 parent a945a3d commit ed5f3a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter_computer-vision/anchor.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ paddle.set_printoptions(2) # 精简输出精度

假设输入图像的高度为$h$,宽度为$w$。
我们以图像的每个像素为中心生成不同形状的锚框:*缩放比*为$s\in (0, 1]$,*宽高比*为$r > 0$。
那么[**锚框的宽度和高度分别是$ws\sqrt{r}$和$hs/\sqrt{r}$。**]
那么[**锚框的宽度和高度分别是$hs\sqrt{r}$和$hs/\sqrt{r}$。**]
请注意,当中心位置给定时,已知宽和高的锚框是确定的。

要生成多个不同形状的锚框,让我们设置许多缩放比(scale)取值$s_1,\ldots, s_n$和许多宽高比(aspect ratio)取值$r_1,\ldots, r_m$。
Expand Down

0 comments on commit ed5f3a0

Please sign in to comment.