mirror of https://github.com/WongKinYiu/yolov7.git
parent
e44853eb4b
commit
09b8e34ae5
|
@ -102,7 +102,7 @@ class Conv(nn.Module):
|
||||||
super(Conv, self).__init__()
|
super(Conv, self).__init__()
|
||||||
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False)
|
self.conv = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=False)
|
||||||
self.bn = nn.BatchNorm2d(c2)
|
self.bn = nn.BatchNorm2d(c2)
|
||||||
self.act = nn.LeakyReLU(0.1, inplace=True) if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
|
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
|
||||||
|
|
||||||
def forward(self, x):
|
def forward(self, x):
|
||||||
return self.act(self.bn(self.conv(x)))
|
return self.act(self.bn(self.conv(x)))
|
||||||
|
@ -477,7 +477,7 @@ class RepConv(nn.Module):
|
||||||
|
|
||||||
padding_11 = autopad(k, p) - k // 2
|
padding_11 = autopad(k, p) - k // 2
|
||||||
|
|
||||||
self.act = nn.LeakyReLU(0.1, inplace=True) if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
|
self.act = nn.SiLU() if act is True else (act if isinstance(act, nn.Module) else nn.Identity())
|
||||||
|
|
||||||
if deploy:
|
if deploy:
|
||||||
self.rbr_reparam = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=True)
|
self.rbr_reparam = nn.Conv2d(c1, c2, k, s, autopad(k, p), groups=g, bias=True)
|
||||||
|
|
Loading…
Reference in New Issue