LPRNet_Pytorch
LPRNet_Pytorch copied to clipboard
some problem about forward in LPRNet
trafficstars
Thank you for your work. I have some question about the forword function in LPRNet.py. from the global_context=list() to the x = self.container(x) AS I know , do you use the head as fpn in the detector to fuse the feature from different feature map? Then you use a 1*1 conv to combine the four feature map, and use the mean of the result as the output.
here is the code in your LPRNet.py
global_context = list() for i, f in enumerate(keep_features): if i in [0, 1]: f = nn.AvgPool2d(kernel_size=5, stride=5)(f) if i in [2]: f = nn.AvgPool2d(kernel_size=(4, 10), stride=(4, 2))(f) f_pow = torch.pow(f, 2) f_mean = torch.mean(f_pow) f = torch.div(f, f_mean) global_context.append(f)
x = torch.cat(global_context, 1)
x = self.container(x)
logits = torch.mean(x, dim=2)