Code refactor https://ultralytics.com/actions (#13844)
This commit is contained in:
parent
ffb46fd7fb
commit
ecfcdf12c9
13 changed files with 21 additions and 18 deletions
|
|
@ -789,7 +789,7 @@ class CIB(nn.Module):
|
|||
self.cv1 = nn.Sequential(
|
||||
Conv(c1, c1, 3, g=c1),
|
||||
Conv(c1, 2 * c_, 1),
|
||||
Conv(2 * c_, 2 * c_, 3, g=2 * c_) if not lk else RepVGGDW(2 * c_),
|
||||
RepVGGDW(2 * c_) if lk else Conv(2 * c_, 2 * c_, 3, g=2 * c_),
|
||||
Conv(2 * c_, c2, 1),
|
||||
Conv(c2, c2, 3, g=c2),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -110,8 +110,7 @@ class Detect(nn.Module):
|
|||
else:
|
||||
dbox = self.decode_bboxes(self.dfl(box), self.anchors.unsqueeze(0)) * self.strides
|
||||
|
||||
y = torch.cat((dbox, cls.sigmoid()), 1)
|
||||
return y
|
||||
return torch.cat((dbox, cls.sigmoid()), 1)
|
||||
|
||||
def bias_init(self):
|
||||
"""Initialize Detect() biases, WARNING: requires stride availability."""
|
||||
|
|
|
|||
|
|
@ -693,7 +693,7 @@ class Ensemble(nn.ModuleList):
|
|||
|
||||
|
||||
@contextlib.contextmanager
|
||||
def temporary_modules(modules={}, attributes={}):
|
||||
def temporary_modules(modules=None, attributes=None):
|
||||
"""
|
||||
Context manager for temporarily adding or modifying modules in Python's module cache (`sys.modules`).
|
||||
|
||||
|
|
@ -718,6 +718,10 @@ def temporary_modules(modules={}, attributes={}):
|
|||
applications or libraries. Use this function with caution.
|
||||
"""
|
||||
|
||||
if modules is None:
|
||||
modules = {}
|
||||
if attributes is None:
|
||||
attributes = {}
|
||||
import sys
|
||||
from importlib import import_module
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue