From d9e921c74388105518e2ba89e0a7e948b5bc3be9 Mon Sep 17 00:00:00 2001 From: WenmuZhou Date: Fri, 6 Nov 2020 18:15:44 +0800 Subject: [PATCH] change align_mode to 1 --- ppocr/modeling/necks/db_fpn.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ppocr/modeling/necks/db_fpn.py b/ppocr/modeling/necks/db_fpn.py index 02669e8a..710023f3 100644 --- a/ppocr/modeling/necks/db_fpn.py +++ b/ppocr/modeling/necks/db_fpn.py @@ -97,17 +97,20 @@ class DBFPN(nn.Layer): in3 = self.in3_conv(c3) in2 = self.in2_conv(c2) - out4 = in4 + F.upsample(in5, scale_factor=2, mode="nearest") # 1/16 - out3 = in3 + F.upsample(out4, scale_factor=2, mode="nearest") # 1/8 - out2 = in2 + F.upsample(out3, scale_factor=2, mode="nearest") # 1/4 + out4 = in4 + F.upsample( + in5, scale_factor=2, mode="nearest", align_mode=1) # 1/16 + out3 = in3 + F.upsample( + out4, scale_factor=2, mode="nearest", align_mode=1) # 1/8 + out2 = in2 + F.upsample( + out3, scale_factor=2, mode="nearest", align_mode=1) # 1/4 p5 = self.p5_conv(in5) p4 = self.p4_conv(out4) p3 = self.p3_conv(out3) p2 = self.p2_conv(out2) - p5 = F.upsample(p5, scale_factor=8, mode="nearest") - p4 = F.upsample(p4, scale_factor=4, mode="nearest") - p3 = F.upsample(p3, scale_factor=2, mode="nearest") + p5 = F.upsample(p5, scale_factor=8, mode="nearest", align_mode=1) + p4 = F.upsample(p4, scale_factor=4, mode="nearest", align_mode=1) + p3 = F.upsample(p3, scale_factor=2, mode="nearest", align_mode=1) fuse = paddle.concat([p5, p4, p3, p2], axis=1) return fuse -- GitLab