From bdebfb5fb451549990829abb911da07af112a33d Mon Sep 17 00:00:00 2001 From: Anthony Allams <31600993+anthonyallams@users.noreply.github.com> Date: Mon, 18 Oct 2021 00:03:47 +0100 Subject: [PATCH] Update yolo.py --- models/yolo.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/yolo.py b/models/yolo.py index 145df4c..c340310 100644 --- a/models/yolo.py +++ b/models/yolo.py @@ -138,8 +138,8 @@ def _initialize_biases(self, cf=None): # initialize biases into Detect(), cf is m = self.model[-1] # Detect() module for mi, s in zip(m.m, m.stride): # from b = mi.bias.view(m.na, -1) # conv.bias(255) to (3,85) - b[:, 4] += math.log(8 / (640 / s) ** 2) # obj (8 objects per 640 image) - b[:, 5:] += math.log(0.6 / (m.nc - 0.99)) if cf is None else torch.log(cf / cf.sum()) # cls + b[:, 4].data += math.log(8 / (640 / s) ** 2) # obj (8 objects per 640 image) + b[:, 5:].data += math.log(0.6 / (m.nc - 0.99)) if cf is None else torch.log(cf / cf.sum()) # cls mi.bias = torch.nn.Parameter(b.view(-1), requires_grad=True) def _print_biases(self):